Number of Lattice Points on a Circle I have made the following conjecture:the number of lattice points on a circle with equation $x^2 +y^2 = n$, where $n$ is an integer with a prime factorization containing only primes in the form of $4k+1$, is four times the number of divisors of $n$.
So, for example, consider the circle $x^2 +y^2 = 65$. In this case, $65 = 1 \times 5 \times 13$ and the divisors of 65 are $1,5,13,65$. Thus, by my conjecture, the number of lattice points on this circle is $4 \times 4$ which is 16 lattice points.
I do not know how to go about this proof, and any help would be appreciated.
 A: Your conjecture is correct and well-known. $\mathbb{Z}[i]$ is an Euclidean domain, hence a UFD. In particular every prime $p\in\mathbb{Z}$ of the form $4k+3$ is a prime in $\mathbb{Z}[i]$ too, while every prime $p\in\mathbb{Z}$ of the form $p=4k+1$ factors as $\mathfrak{p}\cdot\overline{\mathfrak{p}}$ in $\mathbb{Z}[i]$. In equivalent terms, every prime $p\in\mathbb{Z}$ of the form $4k+1$ can be represented in a essentially unique way as $a^2+b^2$ (up to exchanging $a$ and $b$ or reversing the sign of one or both of them). Since the norm over $\mathbb{Z}[i]$ is multiplicative we have the Lagrange/Brahmagupta-Fibonacci identity
$$(a^2+b^2)(c^2+d^2) = (ac-bd)^2+(ad+bc)^2$$
and the representation function
$$ r_2(n)=\left|\left\{(a,b)\in\mathbb{Z}^2:a^2+b^2=n\right\}\right| $$
turns out to be a constant multiple of a multiplicative function, where the involved constant is just the number of invertible elements in $\mathbb{Z}[i]$, i.e. $4$:
$$ r_2(n) = 4\sum_{d\mid n}\chi_4(d) = 4\left(\chi_4*1\right)(n) $$
where $\chi_4$ is the non-primitive Dirichlet character $\!\!\pmod{4}$. In particular, if each prime divisor of $n$ is of the form $4k+1$ we simply have $r_2(n) = 4\,d(n)$ as conjectured.
