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.

A064809 Decimal expansion of Pi written as a sequence of positive integers avoiding duplicates.

Original entry on oeis.org

3, 1, 4, 15, 9, 2, 6, 5, 35, 8, 97, 93, 23, 84, 62, 64, 33, 83, 27, 950, 28, 841, 971, 69, 39, 937, 510, 58, 20, 974, 94, 45, 92, 30, 7, 81, 640, 628, 620, 89, 98, 6280, 34, 82, 53, 42, 11, 70, 67, 982, 14, 80, 86, 51, 32, 8230, 66, 470, 938, 44, 60, 95, 50, 582, 231, 72
Offset: 1

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 22 2001

Keywords

Comments

Start with the first digit of Pi and set a(1)=3. Let p(1),...,p(i) be the digits of Pi used to construct a(1),...,a(n); then a(n+1) is the smallest integer with digits p(i+1),...,p(i+j) such that a(n+1) is new and p(i+j+1) != 0.
Is the sequence a permutation of the positive integers?

Examples

			Pi = 3.141592653589...
		

Crossrefs

Cf. A000796.

Programs

  • Python
    from itertools import islice
    from sympy import S
    # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
    # with open('pi-billion.txt', 'r') as f: pi_digits = f.readline()
    pi_digits = str(S.Pi.n(10**5))[:-1] # alternative to above
    pi_digits = pi_digits.replace(".", "")
    def diggen(): yield from map(int, pi_digits)
    def agen(): # generator of terms
        g = diggen()
        aset, nextd = set(), next(g)
        while True:
            an, nextd = nextd, next(g)
            while an in aset or nextd == 0:
                an, nextd = int(str(an) + str(nextd)), next(g)
            yield an
            aset.add(an)
    print(list(islice(agen(), 66))) # Michael S. Branicky, Mar 31 2022