cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A146326 Length of the period of the continued fraction of (1+sqrt(n))/2.

Original entry on oeis.org

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
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

First occurrence of n in this sequence see A146343.
Records see A146344.
Indices where records occurred see A146345.
a(n) =0 for n = k^2 (A000290).
a(n) =1 for n = 4 k^2 + 4 k + 5 (A078370). For primes see A005473.
a(n) =2 for n in A146327. For primes see A056899.
a(n) =3 for n in A146328. For primes see A146348.
a(n) =4 for n in A146329. For primes see A028871 - {2}.
a(n) =5 for n in A146330. For primes see A146350.
a(n) =6 for n in A146331. For primes see A146351.
a(n) =7 for n in A146332. For primes see A146352.
a(n) =8 for n in A146333. For primes see A146353.
a(n) =9 for n in A143577. For primes see A146354.
a(n)=10 for n in A146334. For primes see A146355.
a(n)=11 for n in A146335. For primes see A146356.
a(n)=12 for n in A146336. For primes see A146357.
a(n)=13 for n in A333640. For primes see A146358.
a(n)=14 for n in A146337. For primes see A146359.
a(n)=15 for n in A146338. For primes see A146360.
a(n)=16 for n in A146339. For primes see A146361.
a(n)=17 for n in A146340. For primes see A146362.

Examples

			a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.
		

Crossrefs

Programs

  • 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 *)

Formula

a(n) = 0 iff n is a square (A000290). - Robert G. Wilson v, Apr 11 2017

Extensions

a(39) and a(68) corrected by R. J. Mathar, Sep 06 2009

A146340 Numbers k such that continued fraction of (1 + sqrt(k))/2 has period 17.

Original entry on oeis.org

521, 617, 709, 1433, 1597, 2549, 2909, 2965, 3161, 3581, 3821, 4013, 4285, 4649, 5501, 5585, 5693, 5813, 6197, 6409, 7825, 7853, 8093, 8125, 8573, 8917, 9281, 9665, 9677, 9925, 10265, 10597, 10973, 11273, 12085, 12805, 13061, 13109, 13613, 13957, 14677
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146362.

Examples

			a(1) = 521 because continued fraction of (1+sqrt(521))/2 = 11, 1, 10, 2, 5, 4, 2, 1, 1, 1, 1, 2, 4, 5, 2, 10, 1, 21, 1, 10, 2, 5, 4, 2, 1, 1, 1, 1, 2, 4, 5, 2, 10, 1, 21, 1, 10, 2, 5, ... has period (1, 10, 2, 5, 4, 2, 1, 1, 1, 1, 2, 4, 5, 2, 10, 1, 21) length 17.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: isA146340 := proc(n) RETURN(A146326(n) = 17) ; end: for n from 2 do if isA146340(n) then printf("%d,\n",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    cf17Q[n_]:=Module[{s=(1+Sqrt[n])/2},If[IntegerQ[s], 1,Length[ ContinuedFraction[ s][[2]]]]==17]; Select[Range[5000],cf17Q] (* Harvey P. Dale, Dec 20 2017 *)

Extensions

998 and 1006 removed, sequence extended by R. J. Mathar, Sep 06 2009
More terms from Harvey P. Dale, Dec 20 2017

A333640 Numbers k such that the continued fraction of (1 + sqrt(k))/2 has period 13.

Original entry on oeis.org

421, 757, 1021, 1097, 1117, 1241, 1301, 1553, 1625, 1649, 1973, 2069, 2125, 2237, 2249, 2273, 2665, 2789, 2861, 3085, 3349, 3373, 3461, 3517, 3545, 3877, 3917, 4133, 4397, 4481, 4573, 4589, 4885, 5389, 5521, 5573, 5713, 5717, 6185, 6221, 6317, 6637, 6997, 7093
Offset: 1

Views

Author

Amiram Eldar, Mar 31 2020

Keywords

Comments

For primes in this sequence see A146358.

Examples

			a(1) = 421 because the continued fraction of (1 + sqrt(421))/2 = 10, 1, 3, 6, 1, 1, 2, 2, 1, 1, 6, 3, 1, 19, 1, 3, 6, ... has a period (1, 3, 6, 1, 1, 2, 2, 1, 1, 6, 3, 1, 19) of length 13.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^4], !IntegerQ @ Sqrt[#] && Length[ContinuedFraction[(1 + Sqrt[#])/2][[2]]] == 13 &]
Showing 1-3 of 3 results.