$y = \sqrt{5x^2+2x+1} \implies (5 x + 1)^2 - 5 y^2 = -4$
gp-code:
pell()=
{
D= 5; C= -4;
Q= bnfinit('x^2-D, 1);
fu= Q.fu[1]; \\print("Fundamental Unit: "fu);
N= bnfisintnorm(Q, C); \\print("Fundamental Solutions (Norm): "N"\n");
for(i=1, #N, ni= N[i];
for(j=0, 100,
s= lift(ni*fu^j);
X= abs(polcoeff(s, 0)); Y= abs(polcoeff(s, 1));
if(X^2-D*Y^2==C,
x= (X-1)/5; y= Y;
if(x==floor(x),
print("("x", "y")")
)
)
)
)
};
Solutions:
(0, 1)
(2, 5)
(15, 34)
(104, 233)
(714, 1597)
(4895, 10946)
(33552, 75025)
(229970, 514229)
(1576239, 3524578)
(10803704, 24157817)
(74049690, 165580141)
(507544127, 1134903170)
(3478759200, 7778742049)
(23843770274, 53316291173)
(163427632719, 365435296162)
(1120149658760, 2504730781961)
(7677619978602, 17167680177565)
(52623190191455, 117669030460994)
(360684711361584, 806515533049393)
(2472169789339634, 5527939700884757)
(16944503814015855, 37889062373143906)
(116139356908771352, 259695496911122585)
(796030994547383610, 1779979416004714189)
(5456077604922913919, 12200160415121876738)
(37396512239913013824, 83621143489848422977)
(256319508074468182850, 573147844013817084101)
0,4,8,12,16,20,..
. Example forj
=16
:(x-1)*Mod(1/2*x - 1/2, x^2 - 5)^16
=Mod(1597*x - 3571, x^2 - 5)
. I.e.y
=1597
andx
=(3571-1)/5
=714
. – Dmitry Ezhov May 23 '20 at 16:04