login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A062328
Length of period of continued fraction expansion of square root of 3^n+1.
1
1, 0, 1, 4, 1, 26, 1, 56, 1, 44, 1, 264, 1, 814, 1, 136, 1, 3730, 1, 20968, 1, 2448, 1, 287980, 1, 397238, 1, 2678, 1, 670896, 1, 8110044, 1, 20696, 1, 1066520, 1, 366601254, 1, 277444, 1, 5903828476, 1, 7701738148, 1, 8208058, 1, 30287795640, 1, 253244432640, 1, 11656644672, 1, 2376211301858, 1, 590009437260, 1
OFFSET
0,4
COMMENTS
a(n) = 1 iff n is even. In this case, 3^n + 1 = A002522(3^(n/2)) and the continued fraction expansion of sqrt(3^n+1) is {3^(n/2); 2*3^(n/2), 2*3^(n/2), 2*3^(n/2), 2*3^(n/2), ...}. - Bernard Schott, Sep 25 2019
FORMULA
a(n) = A003285(A034472(n)). - Bernard Schott, Sep 25 2019
EXAMPLE
The period of sqrt(244) contains 26 terms: [1, 1, 1, 1, 1, 2, 1, 5, 1, 1, 9, 1, 6, 1, 9, 1, 1, 5, 1, 2, 1, 1, 1, 1, 1, 30], so a(5) = 26.
MAPLE
with(numtheory): [seq(nops(cfrac(sqrt(3^k+1), 'periodic', 'quotients')[2]), k=2..18)];
MATHEMATICA
Table[Length[Last[ContinuedFraction[Sqrt[3^w+1]]]], {w, 1, 40}] (* corrected by Harvey P. Dale, Dec 05 2014 *)
KEYWORD
nonn,more
AUTHOR
Labos Elemer, Jul 13 2001
EXTENSIONS
More terms from Harvey P. Dale, Dec 05 2014
a(41)-a(42) from Vaclav Kotesovec, Sep 17 2019
a(0), a(43)-a(48) from Chai Wah Wu, Sep 25 2019
a(49)-a(56) from Chai Wah Wu, Oct 03 2019
STATUS
approved