OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
MAPLE
A := proc(n) local c; try c := numtheory[cfrac](1/2+sqrt(n)/2, 'periodic', 'quotients') ; RETURN(nops(c[2]) ); catch: RETURN(-1) end try ; end: A146343 := proc(n) for k from 1 do if A(k) = n then RETURN(k); fi; od: end: for n from 1 to 30 do printf("%d, ", A146343(n)) ; od: # R. J. Mathar, Nov 08 2008
MATHEMATICA
nn = 50; t = Table[0, {nn}]; cnt = 0; k = 1; While[cnt < nn, k++; cf = ContinuedFraction[(1 + Sqrt[k])/2]; If[Head[cf[[-1]]] === List, len = Length[cf[[-1]]]; If[len <= nn && t[[len]] == 0, t[[len]] = k; cnt++]]]; t
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Oct 30 2008
EXTENSIONS
a(6) changed to 18, a(25) to 929, a(28) to 334 by R. J. Mathar, Nov 08 2008
Extended by T. D. Noe, Mar 22 2011
STATUS
approved