Let $p$ be an odd prime number.
Let $c$ be a given integer between $0$ and $p-1$.
It seems that for every $p$ and every $c$ we can find integers $a,b$ such that :
$$ a^2 + p b^2 = c \mod p^2 $$
Is this true ?
And if so why ? How to prove it ?
Some arguments :
- We know that $50 $% is a quadratic residue.
See also
https://en.wikipedia.org/wiki/Cipolla%27s_algorithm
Can Cipolla algorithm be used as a primality test?
for computing sqrt mod or factoring.
So adding $a^2 + p b^2$ seems likely to be any $c$ by a density argument.
- And we know that $a^2 + p b^2$ is closed under multiplication since it is the norm of a ring.
See Brahmagupta's identity : https://en.wikipedia.org/wiki/Brahmagupta%27s_identity
Therefore if $c_1$ and $c_2$ have a solution then so does $c_3 = c_1 c_2$.
This seems to suggest we only need to consider $c$ being $1$ or prime.
- It is also believed that most numbers are a sum of square and a squareful number.
So these 3 seem to suggest it is likely true.
But I found no proof nor counterexample.
Maybe it matters if the associated ring is a UFD or not.
Or maybe it matters if $p$ is an idoneal number.
see : https://en.wikipedia.org/wiki/Idoneal_number
The question reminds me - justified or not - of this one I asked earlier :
Generating residues with $ a^n + b^n \mod p $
There are also some theorems and factorizations based on $\mod p^2$ but I am no expert in that.
I am not certain how hard or easy this problem is. Special cases led to diophantine in 4 th degree, but those are probably overkill or not the best way to go.
The fact that $p$ needs to be an odd prime might be the problem when reducing to diophantines.
Im not sure if infinite descent will work.
I also had the idea that $a^2$ and $p b^2$ could be primes over 2 in that mod. That would lead to a goldbach type idea.
So many things seem related.
But I was not able to find a proof.
Maybe the quadratic reciprocity theorem will help us.
Also possibly related :
The diophantine equation $ m = x^2 + 7y^2 $
and maybe this
solving for Gauss's composition law
The above is the main question.
I was thinking about the $\mod p^3$ case too, but I think that is false...