We are given with $$S_n=\{(x,y)|x^2+y^2=n, \text{where }x,y,n \in \mathbb Z\text{ and }n\geq0 \}$$ Now observe that $-\sqrt n\leq x\leq\sqrt n $ and similarily, $-\sqrt n\leq y\leq\sqrt n $. This means that $-\left \lfloor{\sqrt n}\right \rfloor\leq x\leq \left \lfloor{\sqrt n}\right \rfloor$ and $-\left \lfloor{\sqrt n}\right \rfloor\leq y\leq \left \lfloor{\sqrt n}\right \rfloor$. Through this result one can easily write code and figure out the cardinality of set $S_i$ but I was wondering whether an expression can be found that would allow one to directly compute $|S_i|$.
2026-02-27 23:48:04.1772236084
Find the cardinality of the following set $S_n=\{(x,y)|x^2+y^2=n, \text{where }x,y,n \in \mathbb Z\text{ and }n\geq0 \}$
583 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in COMBINATORICS
- Using only the digits 2,3,9, how many six-digit numbers can be formed which are divisible by 6?
- The function $f(x)=$ ${b^mx^m}\over(1-bx)^{m+1}$ is a generating function of the sequence $\{a_n\}$. Find the coefficient of $x^n$
- Name of Theorem for Coloring of $\{1, \dots, n\}$
- Hard combinatorial identity: $\sum_{l=0}^p(-1)^l\binom{2l}{l}\binom{k}{p-l}\binom{2k+2l-2p}{k+l-p}^{-1}=4^p\binom{k-1}{p}\binom{2k}{k}^{-1}$
- Algebraic step including finite sum and binomial coefficient
- nth letter of lexicographically ordered substrings
- Count of possible money splits
- Covering vector space over finite field by subspaces
- A certain partition of 28
- Counting argument proof or inductive proof of $F_1 {n \choose1}+...+F_n {n \choose n} = F_{2n}$ where $F_i$ are Fibonacci
Related Questions in NUMBER-THEORY
- Maximum number of guaranteed coins to get in a "30 coins in 3 boxes" puzzle
- Interesting number theoretical game
- Show that $(x,y,z)$ is a primitive Pythagorean triple then either $x$ or $y$ is divisible by $3$.
- About polynomial value being perfect power.
- Name of Theorem for Coloring of $\{1, \dots, n\}$
- Reciprocal-totient function, in term of the totient function?
- What is the smallest integer $N>2$, such that $x^5+y^5 = N$ has a rational solution?
- Integer from base 10 to base 2
- How do I show that any natural number of this expression is a natural linear combination?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
Related Questions in REPRESENTATIONS-BY-QUADRATIC-FORMS
- Group structure on the Dirichlet binary composition of quadratic forms
- When can an odd integer $d$ be represented as $d=a^2-2b^2$ with coprime integers $a,b\ $?
- Is $X + \frac{2}{X}$ a rational quadratic form, where $X \in \mathbb{Q} \setminus \mathbb{Z}$?
- Binary Quadratic Forms of Discriminant -3
- Primes Represented By Quadratic Forms With Discriminant $-35$
- If an indefinite quadratic form represents $1$ over $\mathbb Q$, does it represent $1$ over $\mathbb Z$?
- Jacobi's Four square problem using Ramanujans Summation formula
- If $3\omega^2-2n\omega\psi+\psi^2+1=0$ has a rational solution then it has an integer solution?
- Find the cardinality of the following set $S_n=\{(x,y)|x^2+y^2=n, \text{where }x,y,n \in \mathbb Z\text{ and }n\geq0 \}$
- How to solve Hoffman & Kunze exercise 8, section 10.2?
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Let us denote the size $|S_n|$ as $r_2(n)$, as is done in this answer and on this Wolfram page. It can be computed as $$ r_2(n) = 4 \sum_{\text{odd } d \mid n} (-1)^{\frac{d-1}{2}}. $$ However, this formula is a bit cryptic. More usefully, $\frac{r_2(n)}{4}$ is multiplicative, that is for $a$ and $b$ relatively prime, $\frac{r_2(ab)}{4} = \frac{r_2(a)}{4} \cdot \frac{r_2(b)}{4}$. And, for a prime $p$: $$ r_2(p^k) = 4 \cdot \begin{cases} 1 & \text{if } p = 2 \\ 0 & \text{if } p \equiv 3 \pmod{4} \text{ and } k \text{ is odd} \\ 1 & \text{if } p \equiv 3 \pmod{4} \text{ and } k \text{ is even} \\ (k+1) & \text{if } p \equiv 1 \pmod{4}. \end{cases} $$ So this gives another way to write $r_2(n)$: if every odd prime congruent to $3$ mod $4$ divides into $n$ an even number of times, then we have $$ r_2(n) = 4 \prod_{\substack{p \equiv 1 \pmod{4} \\ p^k \mid n}} (k+1), $$ where $p^k$ is the highest prime power dividing $n$. Otherwise, $r_2(n) = 0$.
This sequence can be found on OEIS here.
Some special cases:
The sum of two squares theorem: in your context, this says that $|S_n| = 0$ if $n$ contains an odd number of copies of some prime divisor $p \equiv 3 \pmod{4}$, and $|S_n| > 0$ otherwise.
For $p, q$ distinct primes $\equiv 1 \pmod{4}$, $|S_p| = |S_q| = 8$ and $|S_{pq}| = 16$. (Because we allow for $x, y < 0$, a factor of $4$ arises for the sign of $x$ and $y$, and a factor of $2$ is for switching $x$ and $y$.) This is discussed in some related questions.
The most trivial case, $|S_1| = 4$. We could also define $|S_0| = 1$, but most of the formulas in this answer don't apply for $|S_0|$.
Generating function:
$$ \sum_{n=1}^\infty r_2(n) x^n = 4\sum_{k=\color{red}{0}}^\infty \frac{(-1)^{k} x^{2k+1}}{1 - x^{2k+1}} = 4 \sum_{k=\color{red}{1}}^\infty \frac{x^{k}}{1 + x^{2k}}, $$
which can also be written as an infinite product involving Pochhamer symbols if we like. This is derived from the formula at the top of this post.
Cumulative sums: Gauss's circle problem
Finally, others have mentioned Gauss's circle problem. $\sum_{n=0}^{N} |S_n|$ is the number of integer coordinates inside a circle of radius $\sqrt{N}$ about the origin. Therefore it approximates the area of that circle, and we have $$ \sum_{n=0}^{N} r_2(n) \approx N \pi. $$
Notes on how to prove the formulas
I do not provide a proof here of the formulas for $r_2(n)$. The basic idea is that they come from Gaussian integer factorization (unique factorization property in the ring $\mathbb{Z}[i]$). In particular, every $(a,b)$ such that $n = a^2 + b^2$ corresponds to a factorization $$ n = (a + bi)(a - bi), $$ so to count the number of such factorizations we can count the number of ways to write $n = z \overline{z}$ where $z \in \mathbb{Z}[i]$. Then we factorize $n$ in the Gaussian integers, where the primes equivalent to $3$ mod $4$ do not decompose, but the primes equivalent to $1$ mod $4$ split into pairs. Using this, we can derive the desired formulas.