<s>[INST] What can we tell about quadratic residues modulo $an+b$ ($n=1,2,\dots$)? I only know a little about quadratic residues, and I have a question that: What can we say about quadratic residues modulo $an+b$, for example, $30n+1$? $(n=1,2,\dots)$
Of course, $0,1,4,9,16,25$ are quadratic resiudes modulo $30n+1$ for all $n$.
However, $2$ is a quadratic residue mod $31$ while it is not a quadratic residue modulo $61$.
Are there any relations between quadratic residues modulo $30n+1$?
(For example, a statement such as $cn+d$ is a quadratic residue modulo $30n+1$.)
 [/INST] Comment: we can find a family of x such that :
$x^2\equiv (cn+t)\bmod (3n+1)$
With some conditions. we must have:
$x^2=m(30n +1)+cn+d=n(30m+c)+m+d$
Suppose $m+d=t^2$ we have:
$(x-t)(x+t)=n(30m+c)$
Suppose:
$\begin{cases}x-t=n\\x+t=30m+c\end {cases}$
We get following conditions:
$\begin{cases} m+d=t^2\\x=\frac 12(30m +n+c)\\t=\frac 12(30m+c-n)\end{cases}$
which leads to solving  a system of Diophantine equation. For example :
for$m=1, n=2, c=4$ we get:
$x=18$
$30n+1=61$
$18^2\equiv 19\bmod 61$
$cn+d=4\times 2+d=19\rightarrow d=11$
$m+d=1+11=12$
Or another example:
which does not meet the condition $m+d=t^2$
But for $m=4$, $n=2$ and $c=6$ we get:
$x=64$
$64^2\equiv 9\bmod 61$
$9=2\times 6-3\Rightarrow d=-3$
$\Rightarrow m+d =4-3=1=1^2$
So residue is $cn+d=6n-3$
That is for particular magnitudes of n there exist numbers like x such that the quadratic residue is of the form $cn+d$.
To find n, m and c  may be a good computer program can give us many residues in form of $cn+d$.
</s>