login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A013945 Least d such that period of continued fraction for sqrt(d) contains n (n^2+2 if n odd, (n/2)^2+1 if n even). 3
3, 2, 11, 5, 27, 10, 51, 17, 83, 26, 123, 37, 171, 50, 227, 65, 291, 82, 363, 101, 443, 122, 531, 145, 627, 170, 731, 197, 843, 226, 963, 257, 1091, 290, 1227, 325, 1371, 362, 1523, 401, 1683, 442, 1851, 485, 2027, 530, 2211, 577, 2403, 626, 2603, 677, 2811 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
G.f.: x(x^5+3x^4-x^3+2x^2+2x+3)/(1-x^2)^3. - N. J. A. Sloane, Jun 12 2004
EXAMPLE
a(3) = 11 because the continued fraction for the square root of 11 is 3, {3, 6}.
MATHEMATICA
Table[If[OddQ[n], n^2 + 2, (n/2)^2 + 1], {n, 100}] (* T. D. Noe, Feb 28 2012 *)
PROG
(PARI) a(n)=if(n%2, n^2+2, (n/2)^2+1) \\ Charles R Greathouse IV, Aug 09 2017
CROSSREFS
Bisections: A164897, A002522.
Sequence in context: A112061 A238398 A065014 * A072656 A330313 A191669
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)