# Quadratic congruences modulo powers of two

### Quadratic congruences modulo powers of two

I have a question regarding a specific case of the equation $$2^{n }$$x + a = $$b^{2 }$$

1) if a is odd: for instance 16x + 17 = $$b^{2 }$$ implies b = 8n+1 or b=8n+7 [I developed a strightforward algorithm for this case]
2) if a is even, but a is not a power of 2: for instance 256x + 68 = $$b^{2 }$$ implies b=64n+18 or b=64n+46 [an algorithm can be derived by the previous case]
3) if a = 0, for instance 256x + 0 = $$b^{2 }$$ implies b=16n [the solutions for this case are simple]
4) if a = 2 can be resolved only for b=$$\pm$$ and n=1

5) I need to have a similar solution b = ...n + ... when a is a power of 2 $$\ge$$ 3
I found an algorithm that enumerates the solutions: https://www.alpertron.com.ar/CUADMOD.HTM, but it is not feaseable for large n and a. Therefore I need a parametric solution.

I really appreciate if somebody have some ideas.
Guest