In the following all variables are non-negative integers.
It is well known (Fermat) that a number $a$ is a sum of two squares $a = x^2 + y^2$ if and only if the prime factors of $a$ of the form $p = 4k+3$ occurs to an even power. Example: $$7^2 \times 5 = 245 = 7^2 + 14^2 \ .$$
I want to count how many solutions there are to the equation $$ x^2 + y^2 \equiv 23 \pmod {93} $$ (it is enough to take $x$ and $y$ from the set $A = \{ 0,1,2,...,92 \}$).
In this case Fermat's Theorem does not hold as it is. For example, we have $23=4 \times 5 + 3$ but $23 + 93 = 116 = 10^2 + 4^2$ is indeed a sum of two squares modulo 93. This also shows that this equation has at least one solution.
There are several strategies to this question:
Check all the possible values of $(x,y) \in A \times A$ explicitly.
Check all the possible values of $\{ b = 23 + 93k \mid k \in \mathbb{Z} \}$ such that $b$ not exceeding $2 \times 93^2$, and see if they are decomposable to sum of two squares.
Both options require a computer program to do all the calculations in a reasonable time. I want a way based on theory with calculations which can be done by hand on the blackboard.
