1

I have a equation $y = \sqrt{5x^2+2x+1}$ and I'm trying to generate integer solutions. I've tried Vieta jumping but it failed.

So I generated by brute force few solutions and find these: x=2, 15, 104, 714, 4895, 33552, 229970... and they get really quickly really big.

I need about 20 of these but I can't search about 10^20 numbers. Do you have any idea how to find exact solution, recurent solution or at least how to lower the search space? thanks ^^

Bernard
  • 175,478

1 Answers1

1

$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)
Dmitry Ezhov
  • 1,653
  • can you please explain me the algorithm :D I dont really understand it XD – Patrik Kula May 23 '20 at 15:17
  • @PatrikKula. All solutions get product Fundamental Solution and power of Fundamental Unit by modulo $(x^2-5)$: $(x-1)\cdot (\frac{1}{2}x-\frac{1}{2})^j \pmod {x^2-5}$, where $j$=0,4,8,12,16,20,... Example for j=16: (x-1)*Mod(1/2*x - 1/2, x^2 - 5)^16=Mod(1597*x - 3571, x^2 - 5). I.e. y=1597 and x=(3571-1)/5=714. – Dmitry Ezhov May 23 '20 at 16:04