OFFSET
1,1
COMMENTS
REFERENCES
O. Perron, "Die Lehre von den Kettenbruechen, Bd.I", Teubner, 1954, 1957 (Sec. 30, table p. 108).
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Wikipedia, Pell's equation
MAPLE
isOddPrim := proc(n::integer)
local cf;
cf := numtheory[cfrac]((sqrt(n)+1)/2, 'periodic', 'quotients') ;
if nops(op(2, cf)) mod 2 =1 then
RETURN(true) ;
else
RETURN(false) ;
fi ;
end:
notA077426 := proc(n::integer)
if issqr(n) then
RETURN(true) ;
elif not isOddPrim(n) then
RETURN(true) ;
else
RETURN(false) ;
fi ;
end:
A077426 := proc(n::integer)
local resul, i ;
resul := 5 ;
i := 1 ;
while i < n do
resul := resul+4 ;
while notA077426(resul) do
resul := resul+4 ;
od ;
i:= i+1 ;
od ;
RETURN(resul) ;
end:
for n from 1 to 61 do print(A077426(n)) ; od : # R. J. Mathar, Apr 25 2006
MATHEMATICA
fQ[n_] := !IntegerQ@ Sqrt@ n && OddQ@ Length@ ContinuedFraction[(Sqrt@ n + 1)/2][[2]]; Select[Range@ 500, fQ] (* Robert G. Wilson v, Nov 17 2012 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Nov 29 2002
EXTENSIONS
Edited and extended by Max Alekseyev, Mar 03 2010
Edited by Max Alekseyev, Mar 05 2010
STATUS
approved