Hello I was wondering is possible to find x in a general form or forms so that there are integer answers for something like the equation below? If so could you point me in the right direction?
$2n^2 + 2n + 1$ mod$ x = 0$
ie
$x = 1,5,13,17$... work and solve the condition.
I think you're asking for what $x$ the equation $2n^2 + 2n + 1$ has a root modulo $x$.
First, since $2n^2 + 2n + 1$ is odd, we can assume that $x$ is odd. Then we can write:
$$2n^2 + 2n + 1 = \frac{1}{2}((2n+1)^2 + 1)$$
This allows us to see that the equation has a solution if and only if there is a square root of $-1$ modulo $x$.
By the Chinese Remainder Theorem, this holds exactly when there is a square root of $-1$ modulo $p^k$ for every prime power $p^k$ dividing $x$.
It's a standard result that this happens when $p\equiv 1\pmod{4}$. This can be seen by looking at the cyclic group of units $\pmod{p^k}$ and seeing when it has order divisible by $4$.
In conclusion, your equation has a solution exactly when all of the prime factors of $x$ are $1\pmod 4$.