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.

A206578 The least number with exactly n ones in the continued fraction of its square root.

Original entry on oeis.org

2, 3, 14, 7, 13, 91, 43, 115, 94, 819, 133, 1075, 211, 1219, 309, 871, 421, 1147, 244, 3427, 478, 2575, 991, 8791, 604, 3799, 886, 5539, 1381, 8851, 1279, 7303, 1561, 19519, 1759, 10339, 1831, 12871, 2038, 13771, 1999, 8611, 1516, 15871, 2731, 20875, 1726
Offset: 0

Views

Author

T. D. Noe, Feb 24 2012

Keywords

Comments

It appears that only the odd-numbered terms 3 and 7 are prime; all other primes occur at even-numbered terms 0, 4, 6, 12, 16, 22, 28, 30, 34, ... In terms 0 to 1000, there are 268 primes and 632 semiprimes.

Crossrefs

Cf. A013647-A013650 (0-3), A020440-A020446 (4-10), A031779-A031868 (11-100).
Cf. A206582 (n twos), A206583 (n threes), A206584 (n fours), A206585 (n fives).

Programs

  • Mathematica
    nn = 50; zeros = nn; t = Table[0, {nn}]; k = 2; While[zeros > 0, If[! IntegerQ[Sqrt[k]], cnt = Count[ContinuedFraction[Sqrt[k]][[2]], 1]; If[cnt <= nn && t[[cnt]] == 0, t[[cnt]] = k; zeros--]]; k++]; Join[{2}, t]
  • Python
    from sympy import continued_fraction_periodic
    def A206578(n):
        m = 1
        while True:
            s = continued_fraction_periodic(0,1,m)[-1]
            if isinstance(s,list) and s.count(1) == n:
                return m
            m += 1 # Chai Wah Wu, Jun 12 2017

A099725 a(n) is the number of 1's in the period of the continued fraction of the square root of the n-th nonsquare integer.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Nov 07 2004

Keywords

Comments

For sufficiently large period lengths, the fraction of 1's in the repeating part tends to log(4/3)/log(2) = 0.415... as from the Gauss-Kuzmin distribution, i.e., a(n) tends to 0.415...*A013943(n) for sufficiently large A013943(n). - A.H.M. Smeets, Jun 02 2018
The "n-th nonsquare integer" in the definition is A005117(n + 1). - Michael B. Porter, Jun 06 2018

Crossrefs

Programs

  • Python
    from math import isqrt
    from sympy.ntheory.continued_fraction import continued_fraction_periodic
    def A099725(n): return (continued_fraction_periodic(0,1,n+(k:=isqrt(n))+int(n>=k*(k+1)+1))[-1]).count(1) # Chai Wah Wu, Jul 20 2024
Showing 1-2 of 2 results.