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.

Previous Showing 21-30 of 135 results. Next

A096493 Number of distinct primes in continued fraction period of square root of n.

Original entry on oeis.org

0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 0, 0, 0, 1, 2, 1, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 3, 0, 1, 1, 2, 1, 1, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0
Offset: 1

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Examples

			n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},
distinct-primes={2,3,7,11}, so a[127]=4;
		

Crossrefs

Programs

  • Mathematica
    {te=Table[0, {m}], u=1}; Do[s=Count[PrimeQ[Union[Last[ContinuedFraction[n^(1/2)]]]], True]; te[[u]]=s;u=u+1, {n, 1, m}];te
    dpcf[n_]:=Module[{s=Sqrt[n]},If[IntegerQ[s],0,Count[Union[ ContinuedFraction[ s][[2]]],?PrimeQ]]]; Array[dpcf,110] (* _Harvey P. Dale, Mar 18 2016 *)

A096494 Largest value in the periodic part of the continued fraction of sqrt(prime(n)).

Original entry on oeis.org

2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 10, 12, 12, 12, 12, 14, 14, 14, 16, 16, 16, 16, 18, 18, 18, 20, 20, 20, 20, 20, 22, 22, 22, 22, 24, 24, 24, 24, 24, 26, 26, 26, 26, 26, 28, 28, 28, 28, 30, 30, 30, 30, 30, 30, 32, 32, 32, 32, 32, 32, 32, 34, 34, 34, 34, 34, 36, 36, 36, 36, 36, 36
Offset: 1

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Examples

			n=31: prime(31) = 127, and the periodic part is {3,1,2,2,7,11,7,2,2,1,3,22}, so a(31)=22.
		

Crossrefs

Programs

  • Haskell
    a096494 = (* 2) . a000006  -- Reinhard Zumkeller, Sep 20 2014
  • Maple
    A096491 := proc(n)
    if issqr(n) then
    sqrt(n) ;
    else
    numtheory[cfrac](sqrt(n),'periodic','quotients') ;
    %[2] ;
    max(op(%)) ;
    end if;
    end proc:
    A096494 := proc(n)
    option remember ;
    A096491(ithprime(n)) ;
    end proc: # R. J. Mathar, Mar 18 2010
  • Mathematica
    {te=Table[0, {m}], u=1}; Do[s=Max[Last[ContinuedFraction[Prime[n]^(1/2)]]]; te[[u]]=s;u=u+1, {n, 1, m}];te
    a[n_]:=IntegerPart[Sqrt[Prime[n]]] 2 IntegerPart[Sqrt[#]]&/@Prime[Range[90]] (* Vincenzo Librandi, Aug 09 2015 *)

Formula

It seems that lim_{n->infinity} a(n)/n = 0. - Benoit Cloitre, Apr 19 2003
a(n) = 2*A000006(n). - Benoit Cloitre, Apr 19 2003

A064932 Period of the continued fraction for sqrt(3^(2n+1)).

Original entry on oeis.org

2, 10, 30, 98, 270, 818, 2382, 7282, 21818, 65650, 196406, 589982, 1768938, 5309294, 15924930, 47779238, 143322850, 429998586, 1289970842, 3869957114, 11609762666, 34829416842, 104488103446
Offset: 1

Views

Author

Wouter Meeussen, Oct 26 2001

Keywords

Comments

Limit_{n->oo} a(n)/3^n = 1.11... - A.H.M. Smeets, Oct 25 2017

References

  • R. K. Guy, personal communication.

Crossrefs

Programs

  • Mathematica
    Table[Length[Last[ContinuedFraction[Sqrt[3^(2n+1)] ]]], {n, 10}]

Formula

a(n) = A003285(A013708(n)). - Michel Marcus, Sep 25 2019

Extensions

a(11)-a(13) from A.H.M. Smeets, Sep 28 2017
a(14) from A.H.M. Smeets, Oct 08 2017
a(15)-a(19) from Daniel Suteu, Jan 24 2019
a(20) from Chai Wah Wu, Sep 23 2019
a(21)-a(23) from Chai Wah Wu, Sep 25 2019

A065938 Position of sqrt(n) in the mapping N2QuQR1 given in A065936.

Original entry on oeis.org

1, 6, 14, 7, 120, 248, 16160, 1019, 127, 32640, 65408, 16373, 8386032, 4194056, 4194239, 32767, 2147450880, 4294934528, 4611672824287851743, 268435343, 8796091842564, 1125899889968159, 70368744112268, 70368744161279
Offset: 1

Views

Author

Antti Karttunen, Dec 07 2001

Keywords

Crossrefs

Cf. A003285. N2QuQR1(a[n])^2 = n, see A065936. For frac2position_in_0_1_SB_tree see A065658. Cf. also A065939.

Programs

  • Maple
    [seq(frac2position_in_0_1_SB_tree(sqrt_n_confrac2binfrac(j)),j=1..40)];
    sqrt_n_confrac2binfrac := proc(n) local c,t; c := CONFRACS_FOR_sqrt_N[n]; t := `if`((1 = nops(c)),[],`if`((0 = (nops(c) mod 2)),[op(c[2..nops(c)]),op(c[2..nops(c)])],c[2..nops(c)])); RETURN( (((2^c[1])-1) + `if`(1 = nops(c),0,(runcounts2binexp0(t) / ((2^(convert(t,`+`)))-1)))) / (2^c[1])); end;
    runcounts2binexp0 := proc(c) local i,e,n; n := 0; for i from 0 to nops(c)-1 do e := c[i+1]; n := ((2^e)*n) + ((i mod 2)*((2^e)-1)); od; RETURN(n); end;
    CONFRACS_FOR_sqrt_N := [[1], [1, 2], [1, 1, 2], [2], [2, 4], [2, 2, 4], [2, 1, 1, 1, 4], [2, 1, 4], [3], [3, 6], etc., adapted from Weisstein's encyclopedia entry for Continued Fractions]

A096492 Number of distinct terms in continued fraction period of square root of n.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 3, 2, 1, 1, 2, 4, 2, 3, 4, 3, 2, 1, 1, 2, 3, 3, 2, 4, 2, 3, 3, 2, 1, 1, 2, 2, 2, 2, 2, 4, 3, 3, 5, 3, 2, 1, 1, 2, 4, 3, 4, 2, 2, 3, 2, 4, 3, 5, 3, 2, 1, 1, 2, 5, 2, 4, 3, 4, 2, 3, 2, 2, 5, 4, 3, 3, 2, 1, 1, 2, 2, 3, 4, 2, 3, 3, 2, 3, 4, 4, 6, 3, 3, 3, 3, 2, 1, 1, 2, 5, 2, 2
Offset: 1

Views

Author

Labos Elemer, Jun 29 2004

Keywords

Comments

Essentially the same as A028832. - Amiram Eldar, Nov 10 2021

Examples

			n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},distinct-terms={1,2,3,7,11,22}, so a[127]=6;
		

Crossrefs

Programs

  • Mathematica
    {tc=Table[0, {m}], u=1}; Do[s=Length[Union[Last[ContinuedFraction[n^(1/2)]]]]; tc[[u]]=s;u=u+1, {n, 1, m}], tc

Formula

a(n) = 1 if n is a square and a(n) = A028832(n) otherwise. - Amiram Eldar, Nov 10 2021

A121339 Periodic part of continued fraction for square roots of integers.

Original entry on oeis.org

2, 1, 2, 4, 2, 4, 1, 1, 1, 4, 1, 4, 6, 3, 6, 2, 6, 1, 1, 1, 1, 6, 1, 2, 1, 6, 1, 6, 8, 4, 8, 2, 1, 3, 1, 2, 8, 2, 8, 1, 1, 2, 1, 1, 8, 1, 2, 4, 2, 1, 8, 1, 3, 1, 8, 1, 8, 10, 5, 10, 3, 2, 3, 10, 2, 1, 1, 2, 10, 2, 10, 1, 1, 3, 5, 3, 1, 1, 10, 1, 1, 1, 10, 1, 2, 1, 10, 1, 4, 1, 10, 1, 10, 12, 6, 12, 4, 12
Offset: 2

Views

Author

Keywords

Examples

			The table starts:
  2
  1 2
  <empty>
  4
  2 4
  1 1 1 4
  1 4
		

Crossrefs

Cf. A003285 (row lengths), A013943 (row lengths for nonempty rows).

Programs

  • Mathematica
    a[n_] := If[ IntegerQ[ Sqrt[n] ], {}, ContinuedFraction[ Sqrt[n] ] // Last]; Table[a[n], {n, 2, 39}] // Flatten (* Jean-François Alcover, Sep 10 2012 *)

A059853 Period of continued fraction for sqrt(n^2+3), n >= 2.

Original entry on oeis.org

4, 2, 6, 4, 2, 6, 10, 2, 12, 16, 2, 16, 20, 2, 10, 10, 2, 12, 10, 2, 28, 10, 2, 26, 16, 2, 18, 48, 2, 34, 12, 2, 26, 32, 2, 32, 32, 2, 20, 70, 2, 56, 34, 2, 24, 22, 2, 54, 52, 2, 70, 16, 2, 18, 38, 2, 16, 36, 2, 12, 72, 2, 114, 30, 2, 64, 32, 2, 52, 54, 2, 22, 92, 2, 154, 88, 2, 56
Offset: 2

Views

Author

Labos Elemer, Feb 27 2001

Keywords

Comments

The old name was "Quotient cycle length of sqrt(n^2+3)." - Jianing Song, May 01 2021

Examples

			sqrt(35^2+3) = [35; 23, 2, 1, 7, 8, 1, 1, 1, 2, 2, 1, 1, 5, 3, 1, 16, 1, 3, 5, 1, 1, 2, 2, 1, 1, 1, 8, 7, 1, 2, 23, 70], so a(35) = 32.
sqrt(36^2+3) = [36; 24, 72], so a(36) = 2.
sqrt(37^2+3) = [37; 24, 1, 2, 7, 1, 8, 2, 1, 1, 1, 2, 2, 5, 1, 3, 18, 3, 1, 5, 2, 2, 1, 1, 1, 2, 8, 1, 7, 2, 1, 24, 74], so a(37) = 32.
		

Crossrefs

Cf. A003285.
Period of continued fraction for sqrt(n^2+k): this sequence (k=3), A059855 (k=4), A059854 (k=5).

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(k^2+3),'periodic','quotients')[2]),k=2..256)];
  • Mathematica
    a[n_] := Length[ContinuedFraction[Sqrt[n^2 + 3]][[2]]]; Array[a, 100, 2] (* Amiram Eldar, Jul 10 2024 *)

Formula

If n is a multiple of 3 then a(n) = 2.
a(n) = A003285(n^2+3). - Jianing Song, May 01 2021

Extensions

New name by Jianing Song, May 01 2021

A059854 Period of continued fraction for sqrt(n^2+5), n >= 3.

Original entry on oeis.org

4, 6, 2, 3, 6, 8, 10, 2, 4, 9, 4, 14, 2, 16, 6, 12, 12, 2, 16, 22, 10, 24, 2, 24, 12, 24, 16, 2, 6, 26, 30, 26, 2, 7, 20, 12, 18, 2, 18, 11, 20, 64, 2, 20, 30, 19, 22, 2, 40, 20, 10, 50, 2, 10, 38, 74, 14, 2, 22, 64, 50, 72, 2, 48, 10, 30, 48, 2, 22, 51, 10, 36, 2, 34, 12, 47, 46, 2
Offset: 3

Views

Author

Labos Elemer, Feb 27 2001

Keywords

Comments

The old name was "Quotient cycle length of sqrt(n^2+5) for n>=3." - Jianing Song, May 01 2021

Examples

			sqrt(13^2+5) = [13; 5, 4, 5, 26], so a(13) = 4.
sqrt(14^2+5) = [14; 5, 1, 1, 1, 2, 1, 8, 1, 2, 1, 1, 1, 5, 28], so a(14) = 14.
sqrt(15^2+5) = [15; 6, 30], so a(15) = 2.
sqrt(16^2+5) = [16; 6, 2, 3, 7, 1, 3, 1, 2, 1, 3, 1, 7, 3, 2, 6, 32], so a(16) = 16.
		

Crossrefs

Cf. A003285.
Period of continued fraction for sqrt(n^2+k): A059853 (k=3), A059855 (k=4), this sequence (k=5).

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(k^2+5), 'periodic', 'quotients')[2]), k=3..256)];
  • Mathematica
    a[n_] := Length[ContinuedFraction[Sqrt[n^2 + 5]][[2]]]; Array[a, 100, 3] (* Amiram Eldar, Jul 10 2024 *)

Formula

If n is a multiple of 5 then a(n) = 2.
a(n) = A003285(n^2+5). - Jianing Song, May 01 2021

Extensions

New name by Jianing Song, May 01 2021

A059855 Period of continued fraction for sqrt(n^2+4), n >= 1.

Original entry on oeis.org

1, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2
Offset: 1

Views

Author

Labos Elemer, Feb 27 2001

Keywords

Comments

From Jianing Song, May 01 2021: (Start)
The old name was "Quotient cycle length of sqrt(n^2+4)."
Essentially the same as A010695 and A021400. (End)

Examples

			For even n, sqrt(n^2+4) = [n; n/2, 2*n], hence a(n) = 2.
For odd n > 1, sqrt(n^2+4) = [n; (n-1)/2, 1, 1, (n-1)/2, 2*n], hence a(n) = 5.
		

Crossrefs

Period of continued fraction for sqrt(n^2+k): A059853 (k=3), this sequence (k=4), A059854 (k=5).

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(k^2+4), 'periodic', 'quotients')[2]), k=1..100)];
  • Mathematica
    a[n_] := Length @ ContinuedFraction[Sqrt[n^2 + 4]][[2]]; Array[a, 100] (* Amiram Eldar, May 13 2020 *)

Formula

a(n) = 2 for even n, a(n) = 5 for odd n > 1.
a(n) = A003285(n^2+4). - Jianing Song, May 01 2021

A077636 Length of periodic part of continued fraction expansion of square root of A051451(n), i.e., sqrt(lcm(1..x)) where x is a prime power from A000961.

Original entry on oeis.org

0, 1, 2, 2, 4, 2, 2, 2, 4, 8, 18, 14, 36, 38, 232, 268, 110, 280, 4348, 3244, 32684, 148184, 207616, 9988, 1946132, 2154482, 13319736, 8971624, 12345748, 69705504, 159413696, 1184191340, 1183672188, 23656693528, 28963250020, 701296434876, 754283490078
Offset: 1

Views

Author

Labos Elemer, Nov 13 2002

Keywords

Examples

			For A051451(10) = 360360, the periodic part is {3,2,1,132,1,2,3,1200} with 8 terms, so a(10) = 8.
		

Crossrefs

Programs

  • Mathematica
    pp = Join[{1}, Select[Range[2, 50], Mod[ #, # - EulerPhi[ # ]] == 0 &]]; Table[ Length[ Last[ ContinuedFraction[ Sqrt[ Apply[ LCM, Table[i, {i, 1, pp[[n]]}]]]]]], {n, 1, 31}]

Formula

a(n) = A003285(A051451(n)). - Michel Marcus, Sep 30 2019

Extensions

Edited and extended by Robert G. Wilson v, Nov 14 2002
a(31) from Ray Chandler, Jan 16 2009
a(32)-a(35) from Chai Wah Wu, Sep 26 2019
a(36) from Chai Wah Wu, Sep 29 2019
a(37) from Chai Wah Wu, Sep 26 2021
Previous Showing 21-30 of 135 results. Next