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-4 of 4 results.

A010121 Continued fraction for sqrt(7).

Original entry on oeis.org

2, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4
Offset: 0

Views

Author

Keywords

Comments

This is a basic member of a family of 4-periodic multiplicative sequences with two parameters (c1,c2), defined for n >= 1 by a(n)=1 if n is odd, a(n)=c1 if n == 0 (mod 4) and a(n)=c2 if n == 2 (mod 4). Here, (c1,c2)=(4,1).
The Dirichlet generating function is (1+(c2-1)/2^s+(c1-c2)/4^s)*zeta(s).
Other members are A010123 with parameters (6,2), A010127 (8,3), A010130 (10,1), A010131 (10,2), A010132 (10,4), A010137 (12,5), A010146 (14,6), A089146 (4,8), A109008 (4,2), A112132 (7,3). If c1=c2, this reduces to the cases discussed in A040001. - R. J. Mathar, Feb 18 2011

Examples

			2.645751311064590590501615753...  = A010465 = 2 + 1/(1 + 1/(1 + 1/(1 + 1/(4 + ...)))).
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 276.

Crossrefs

Cf. A010465 (decimal expansion).

Programs

  • Mathematica
    ContinuedFraction[Sqrt[7],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *)
    CoefficientList[Series[(2 x^2 + 3 x + 2) (x^2 - x + 1) / ((1 - x) (1 + x) (x^2 + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Nov 26 2016 *)
    PadRight[{2},120,{4,1,1,1}] (* Harvey P. Dale, Nov 30 2019 *)
  • PARI
    { allocatemem(932245000); default(realprecision, 13000); x=contfrac(sqrt(7)); for (n=0, 20000, write("b010121.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 01 2009

Formula

From R. J. Mathar, Jun 17 2009: (Start)
G.f.: -(2*x^2+3*x+2)*(x^2-x+1)/((x-1)*(1+x)*(x^2+1)).
a(n) = a(n-4), n > 4. (End)
a(n) = (7 + 3*(-1)^n + 3*(-i)^n + 3*i^n)/4, n > 0, where i is the imaginary unit. - Bruno Berselli, Feb 18 2011

A010501 Decimal expansion of square root of 47.

Original entry on oeis.org

6, 8, 5, 5, 6, 5, 4, 6, 0, 0, 4, 0, 1, 0, 4, 4, 1, 2, 4, 9, 3, 5, 8, 7, 1, 4, 4, 9, 0, 8, 4, 8, 4, 8, 9, 6, 0, 4, 6, 0, 6, 4, 3, 4, 6, 1, 0, 0, 1, 3, 2, 6, 2, 7, 5, 4, 8, 5, 1, 0, 8, 1, 8, 5, 6, 7, 8, 5, 1, 7, 1, 1, 5, 1, 3, 6, 8, 1, 6, 9, 9, 9, 2, 2, 7, 3, 2, 5, 1, 4, 8, 5, 0, 0, 0, 6, 6, 8, 3
Offset: 1

Views

Author

Keywords

Comments

Continued fraction expansion is 6 followed by {1, 5, 1, 12} repeated. - Harry J. Smith, Jun 06 2009

Examples

			6.855654600401044124935871449084848960460643461001326275485108185678517...
		

Crossrefs

Cf. A010137 Continued fraction.

Programs

  • Mathematica
    RealDigits[N[Sqrt[47],200]][[1]] (* Vladimir Joseph Stephan Orlovsky, Feb 24 2011 *)
  • PARI
    { default(realprecision, 20080); x=sqrt(47); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b010501.txt", n, " ", d)); } \\ Harry J. Smith, Jun 06 2009

A067280 Number of terms in continued fraction for sqrt(n), excl. 2nd and higher periods.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 5, 3, 1, 2, 3, 3, 6, 5, 3, 1, 2, 3, 7, 3, 7, 7, 5, 3, 1, 2, 3, 5, 6, 3, 9, 5, 5, 5, 3, 1, 2, 3, 3, 3, 4, 3, 11, 9, 7, 13, 5, 3, 1, 2, 3, 7, 6, 7, 5, 3, 7, 8, 7, 5, 12, 5, 3, 1, 2, 3, 11, 3, 9, 7, 9, 3, 8, 6, 5, 13, 7, 5, 5, 3, 1, 2, 3, 3, 6, 11, 3, 7, 6, 3, 9, 9, 11, 17, 5, 5, 12, 5
Offset: 1

Views

Author

Frank Ellermann, Feb 23 2002

Keywords

Examples

			a(2)=2: [1,(2)+ ]; a(3)=3: [1,(1,2)+ ]; a(4)=1: [2]; a(5)=2: [2,(4)+ ].
		

References

  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th edition, 1999, table 1.

Crossrefs

Related sequences: 2 : A040000, ..., 44: A040037, 48: A040041, ..., 51: A040043, 56: A040048, 60: A040052, 63: A040055, ..., 66: A040057. 68: A040059, 72: A040063, 80: A040071.
Related sequences: 45: A010135, ..., 47: A010137, 52: A010138, ..., 55: A010141, 57: A010142, ..., 59: A010144. 61: A010145, 62: A010146. 67: A010147, 69: A010148, ..., 71: A010150.
Cf. A003285.

Programs

  • Python
    from sympy import continued_fraction_periodic
    def A067280(n): return len((a := continued_fraction_periodic(0,1,n))[:1]+(a[1] if a[1:] else [])) # Chai Wah Wu, Jun 14 2022

Formula

a(n) = A003285(n) + 1. - Andrey Zabolotskiy, Jun 23 2020

Extensions

Name clarified by Michel Marcus, Jun 22 2020

A307530 Primes p for which the continued fraction expansion of sqrt(p) has a single 1 starting at second position.

Original entry on oeis.org

3, 23, 47, 59, 61, 79, 97, 137, 139, 163, 167, 191, 193, 223, 251, 281, 283, 313, 317, 349, 353, 359, 389, 397, 431, 433, 439, 479, 521, 523, 563, 569, 571, 613, 617, 619, 659, 661, 673, 719, 727, 769, 773, 823, 827, 829, 839, 881, 883, 887, 941, 947, 953, 1009
Offset: 1

Views

Author

Michel Marcus, Apr 13 2019

Keywords

Comments

Misak and Ulas prove that the density of primes with k ones is 1/(Fibonacci(k+3)*Fibonacci(k+1)) = 1/3, here with k=1 (a single 1).

Examples

			For p = 3,  we have [1; 1, 2, ...]; see A040001.
For p = 27, we have [4; 1, 3, ...]; see A010127.
For p = 47, we have [6; 1, 5, ...]; see A010137.
		

Crossrefs

Programs

  • PARI
    isok(p) = my(cf = contfrac(sqrt(p))); (cf[2] == 1) && (cf[3] != 1);
    lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", ")));
Showing 1-4 of 4 results.