  Let $X$ be a finite set in the Euclidean space $\mathbb{R}^d$. If any squared
distance of two distinct points in $X$ is an odd integer, then the cardinality
of $X$ is bounded above by $d+2$. Rosenfeld (1997) proved that there exists
$(d+2)$-point $X$ in $\mathbb{R}^d$ having only odd integral squared distances
if and only if $d+2$ is congruent to $0$ modulo $4$. The distances can be
interpreted as an element of the field $\mathbb{Z}/2\mathbb{Z}$. We generalize
this result for a local ring $(A_\mathfrak{p},\mathfrak{p}A_\mathfrak{p})$ as
follows. Let $K$ be an algebraic number field that can be embedded into
$\mathbb{R}$. Fix an embedding of $K$ into $\mathbb{R}$, and $K$ is interpreted
as a subfield of $\mathbb{R}$. Let $A=\mathcal{O}_K$ be the ring of integers of
$K$, and $\mathfrak{p}$ a prime ideal of $\mathcal{O}_K$. Let
$(A_\mathfrak{p},\mathfrak{p}A_\mathfrak{p})$ be the local ring obtained from
the localization $(A\setminus \mathfrak{p})^{-1} A$, which is interpreted as a
subring of $\mathbb{R}$. If the squared distances of $X\subset \mathbb{R}^d$
are in $A_\mathfrak{p}$ and each squared distance is congruent to some constant
$k \not\equiv 0 $ modulo $\mathfrak{p} A_\mathfrak{p}$, then $|X| \leq d+2$. In
this paper, we prove that there exists a set $X\subset \mathbb{R}^d$ attaining
the upper bound $|X| \leq d+2$ if and only if $d+2$ is congruent to $0$ modulo
$4$ when the field $A_\mathfrak{p}/ \mathfrak{p} A_\mathfrak{p}$ is of
characteristic 2, and $d+2$ is congruent to $0$ modulo $p$ when
$A_\mathfrak{p}/ \mathfrak{p} A_\mathfrak{p}$ is of characteristic $p$ odd. We
also construct examples attaining this upper bound.
