OFFSET
5,1
COMMENTS
The golden ratio is the fundamental unit for sqrt(5), but 1/1 isn't a convergent, so this sequence starts with squarefree number A005117(5)=6.
EXAMPLE
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).
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
fun = RootReduce[NumberFieldFundamentalUnits[Sqrt[A005117[[n]]]]][[1]];
converge = Convergents[ContinuedFraction[N[sqr, 140]]];
Flatten[Position[converge, Abs[forcon[[1]]/(forcon[[2]]/ sqr)]]], {n, 4, 101}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ed Pegg Jr, Mar 09 2023
STATUS
approved