OFFSET
1,2
COMMENTS
The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004
Note that primes of the form n^2+1 (A002496) have a continued fraction whose period length is 1; odd primes of the form n^2+2 (A056899) have length 2; odd primes of the form n^2-2 (A028871) have length 4. - T. D. Noe, Nov 03 2006
For an odd prime p, the length of the period is odd if p=1 (mod 4) or even if p=3 (mod 4). - T. D. Noe, May 22 2007
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
MAPLE
with(numtheory): for i from 1 to 150 do cfr := cfrac(ithprime(i)^(1/2), 'periodic', 'quotients'); printf(`%d, `, nops(cfr[2])) od:
MATHEMATICA
Table[p=Prime[n]; Length[Last[ContinuedFraction[Sqrt[p]]]], {n, 100}] (* T. D. Noe, May 22 2007 *)
Length[ContinuedFraction[Sqrt[#]][[2]]]&/@Prime[Range[100]] (* Harvey P. Dale, Sep 28 2024 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, May 05 2000
EXTENSIONS
More terms from James A. Sellers, May 05 2000
STATUS
approved