Find number of ordered pairs $(a, b)$ satisfying $a^2+b^2=2^3\cdot3^4\cdot5\cdot17^2$. By rearranging the terms, I found a pair (918, 306). But I wonder if there is a systematic way to solve for the number of pairs? Any hint will be appreciated!
-
1Mathworld gives a formula for the number of such pairs. – Ross Millikan Jun 15 '20 at 04:42
2 Answers
Since the ring of Gaussian integers $\mathbb{Z}[i]$ is a Euclidean domain, hence a UFD,
$$ r_2(n) = \left|\{(a,b)\in\mathbb{Z}\times\mathbb{Z}: a^2+b^2 = n\}\right| $$ is a constant multiple of a multiplicative function, namely $$ r_2(n) = 4(\chi_4*1)(n)=4\sum_{d\mid n}\chi_4(d)\quad\text{where}\quad \chi_4(d)=\left\{\begin{array}{rcl}0&\text{if}& d\equiv 0\pmod{2}\\ 1&\text{if}&d\equiv 1\pmod{4}\\ -1&\text{if}& d\equiv -1\pmod{4}\end{array}\right. $$ In particular $r_2(n)$ only depends on the prime factors & exponents in the factorization of $n$:
$$ r_2(2^3\cdot 3^4\cdot 5\cdot 17^2)= r_2(3^4\cdot 5\cdot 17^2)=r_2(5\cdot 17^2)=4\tau(5\cdot 17^2)=4\cdot 2\cdot 3=24. $$
Here the possible values for $a$ and $b$, up to sign:
$162,306,\color{red}{666},702,918,954 $
and a practical algorithm for computing $r_2(n)$ by hand, given the factorization of $n$:
- replace $n$ with $n/2^{\nu_2(n)}$, i.e. drop the eventual factor $2^\alpha$
- if some prime $\equiv -1\pmod{4}$ appears with an odd exponent, return 0. Otherwise, drop all these factors
- return four times the number of divisors, i.e. increase all the exponents in the factorization by one and return four times their product.
Related: there are circles which go through an arbitrarily high number of lattice points, since $r_2(5^k)=4k+4$.

- 353,855
Not a 'real' answer, but it was too big for a comment.
I wrote and ran some Mathematica code:
In[1]:=Length[FullSimplify[
Solve[{a^2 + b^2 == 2^3*3^4*5*17^2, b > a}, {a, b}, Integers]]]
Running the code gives:
Out[1]=12
Looking for the solutions, we can see:
In[2]:=FullSimplify[
Solve[{a^2 + b^2 == 2^3*3^4*5*17^2, b > a}, {a, b}, Integers]]
Out[2]={{a -> -954, b -> -162}, {a -> -954, b -> 162}, {a -> -918,
b -> -306}, {a -> -918, b -> 306}, {a -> -702,
b -> -666}, {a -> -702, b -> 666}, {a -> -666,
b -> 702}, {a -> -306, b -> 918}, {a -> -162, b -> 954}, {a -> 162,
b -> 954}, {a -> 306, b -> 918}, {a -> 666, b -> 702}}
So, we can see that when we have $(\text{a},\text{b})$ where $\text{b}>\text{a}$ there are $12$ solutions to that problem.

- 28,671