A361381 In continued fraction convergents of sqrt(d), where d=A005117(n) (squarefree numbers), the position of a/b where abs(a^2 - d*b^2) = 1 or 4.
2, 4, 1, 2, 1, 4, 2, 1, 6, 2, 6, 4, 1, 1, 2, 8, 4, 4, 2, 1, 2, 2, 3, 2, 10, 12, 4, 2, 1, 4, 6, 7, 6, 3, 4, 1, 2, 10, 2, 6, 8, 7, 5, 2, 4, 4, 1, 2, 1, 10, 2, 5, 8, 4, 16, 4, 11, 1, 2, 12, 2, 9, 6, 5, 2, 6, 9, 6, 10, 10, 4, 1, 2, 12, 10, 3, 6, 4, 14, 9, 4, 18, 4, 4, 2, 1, 2, 3, 20, 10, 4, 5, 8, 10, 10, 18, 2, 22
Offset: 5
Keywords
Examples
A005117(13)=19. 170^2 - 19*39^2 = 1. The 6th convergent of sqrt(19) is 170/39. A005117(14)=21. 5^2 - 21*1^2 = 4. The 2nd convergent of sqrt(21) is 5/1. A005117(15)=22. 197^2 - 22*42^2 = 1. The 6th convergent of sqrt(22) is 197/42. A005117(16)=23. 24^2 - 23*5^2 = 1. The 4th convergent of sqrt(23) is 24/5. Corresponding fundamental units are 170+39*sqrt(19), 5+sqrt(21), 197+42*sqrt(22) and 24+5*sqrt(23).
Programs
-
Maple
f:= proc(x) local CF, k,v,w; uses NumberTheory; CF:= ContinuedFraction(sqrt(x)); for k from 0 do v:= Convergent(CF,k); w:= abs(numer(v)^2 - x*denom(v)^2); if w = 1 or w = 4 then return k+1 fi; od end proc: count:= 0: R:= NULL: for i from 6 while count < 100 do if NumberTheory:-IsSquareFree(i) then R:= R, f(i); count:= count+1 fi od: R; # Robert Israel, Mar 12 2023
-
Mathematica
(* store A005117 and A107997 first *) Flatten[Table[sqr = Sqrt[A005117[[n]]]; fun = RootReduce[NumberFieldFundamentalUnits[Sqrt[A005117[[n]]]]][[1]]; forcon = If[MemberQ[A107997, A005117[[n]]], RootReduce[2 fun], fun]; converge = Convergents[ContinuedFraction[N[sqr, 140]]]; Flatten[Position[converge, Abs[forcon[[1]]/(forcon[[2]]/ sqr)]]], {n, 4, 101}]]
Comments