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

A054269 Length of period of continued fraction for sqrt(prime(n)).

Original entry on oeis.org

1, 2, 1, 4, 2, 5, 1, 6, 4, 5, 8, 1, 3, 10, 4, 5, 6, 11, 10, 8, 7, 4, 2, 5, 11, 1, 12, 6, 15, 9, 12, 6, 9, 18, 9, 20, 17, 18, 4, 5, 14, 21, 16, 13, 1, 20, 26, 4, 2, 5, 11, 12, 17, 14, 1, 12, 3, 24, 21, 13, 18, 5, 14, 16, 17, 11, 34, 19, 14, 7, 15, 4, 20, 5, 30, 8, 9, 21, 1, 21, 18, 37, 16
Offset: 1

Views

Author

N. J. A. Sloane, May 05 2000

Keywords

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

Crossrefs

Cf. A003285, A130272 (primes at which the period length sets a new record).

Programs

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

Extensions

More terms from James Sellers, May 05 2000

A059800 Smallest prime p such that the quotient-cycle length in continued fraction expansion of sqrt(p) is n: smallest prime p(m) for which A054269(m)=n.

Original entry on oeis.org

2, 3, 41, 7, 13, 19, 73, 31, 113, 43, 61, 103, 193, 179, 109, 191, 157, 139, 337, 151, 181, 491, 853, 271, 457, 211, 1109, 487, 821, 379, 601, 463, 613, 331, 1061, 1439, 421, 619, 541, 1399, 1117, 571, 1153, 823, 1249, 739, 1069, 631, 1021, 1051, 1201
Offset: 1

Views

Author

Labos Elemer, Feb 23 2001

Keywords

Examples

			The quotient-cycle length L=9=A054269(m) first appears for p(30)=113, so a(9)=113 namely, at first A054269(30)=9; a(A054269(30)) = p(30) = 113 = a(9). The quotient cycle with L=16 first emerges for sqrt(191) and it is: cfrac(sqrt(191), 'periodic', 'quotients')= [[13],[1,4,1,1,3,2,2,13,2 2,3,1,1,4,1,26]].
		

Crossrefs

Formula

a(n) = Min{p|A054269(sequence number of p)=n; p is prime}.
Showing 1-2 of 2 results.