|
|
A146326
|
|
Length of the period of the continued fraction of (1+sqrt(n))/2.
|
|
40
|
|
|
0, 2, 2, 0, 1, 4, 4, 4, 0, 2, 2, 2, 1, 4, 2, 0, 3, 6, 6, 4, 2, 6, 4, 4, 0, 2, 2, 4, 1, 2, 8, 4, 4, 4, 2, 0, 3, 6, 6, 8, 5, 4, 10, 6, 2, 8, 4, 4, 0, 2, 2, 4, 1, 6, 4, 2, 6, 6, 6, 4, 3, 4, 2, 0, 3, 6, 10, 6, 4, 6, 8, 4, 9, 6, 4, 8, 2, 4, 4, 4, 0, 2, 2, 2, 1, 6, 2, 8, 7, 2, 8, 8, 2, 12, 4, 8, 9, 4, 2, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
First occurrence of n in this sequence see A146343.
Indices where records occurred see A146345.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.
|
|
MAPLE
|
A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic', 'quotients') ; nops(%[2]) ; else 0 ; fi; end: seq(A146326(n), n=1..100) ; # R. J. Mathar, Sep 06 2009
|
|
MATHEMATICA
|
Table[cf = ContinuedFraction[(1 + Sqrt[n])/2]; If[Head[cf[[-1]]] === List, Length[cf[[-1]]], 0], {n, 100}]
f[n_] := Length@ ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; Array[f, 100] (* Robert G. Wilson v, Apr 11 2017 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|