I have a question regarding a specific case of the equation [tex]2^{n }[/tex]x + a = [tex]b^{2 }[/tex]

I already resolved several cases

1) if a is odd: for instance 16x + 17 = [tex]b^{2 }[/tex] 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 = [tex]b^{2 }[/tex] 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 = [tex]b^{2 }[/tex] implies b=16n [the solutions for this case are simple]

4) if a = 2 can be resolved only for b=[tex]\pm[/tex] and n=1

5) I need to have a similar solution b = ...n + ... when a is a power of 2 [tex]\ge[/tex] 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.