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

A247747 Whole number sieve of Pi.

Original entry on oeis.org

1, 5, 9, 8, 4, 7, 9, 9, 5, 2, 16, 20, 62, 8, 3, 9, 28, 9, 44, 95, 58, 3, 2, 5, 8, 8, 7, 28, 0, 10, 59, 9, 7, 4, 78, 6, 6, 60, 6, 54, 66, 9, 0, 60, 9, 2, 7, 0, 1, 88, 0, 96, 9, 0, 6, 6, 0, 0, 305, 6, 4, 9, 9, 94, 270, 7, 9, 2, 6, 93, 1, 3, 5, 7, 6, 9, 35, 57, 9, 8, 0
Offset: 1

Views

Author

Gil Broussard, Sep 23 2014

Keywords

Examples

			Find the first occurrence of 0 (the first whole number) in the digits of Pi (only 35 digits in this illustration):
31415926535897932384626433832795028..., and replace it with a space:
31415926535897932384626433832795 28...  Repeat the process with the next whole number, 1:
3 415926535897932384626433832795 28...  Then 2:
3 4159 6535897932384626433832795 28...  Then 3:
  4159 6535897932384626433832795 28...  Then 4,5,6,7, etc., until the first occurrence of every counting number is eliminated from the digits of Pi.
   1    5   9     8    4           ...  Then consolidate gaps between the remaining digits into a single comma:
1,5,9,8,4,7,9,9,5,2,16,20,6,8,3,9, ...  to produce the first terms in the whole number sieve of Pi.
		

Crossrefs

Programs

  • Python
    def arccot(x, unity):
        sum = xpower = unity // x
        n = 3
        sign = -1
        while 1:
            xpower = xpower // (x*x)
            term = xpower // n
            if not term:
                break
            sum += sign * term
            sign = -sign
            n += 2
        return sum
    def pi(digits):
        unity = 10**(digits + 10)
        pi = 4 * (4*arccot(5, unity) - arccot(239, unity))
        return pi // 10**10
    def primes(n):
        """ Returns  a list of primes < n """
        sieve = [True] * n
        for i in range(3, int(n**0.5)+1, 2):
            if sieve[i]:
                sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*i)+1)
        return [2] + [i for i in range(3, n, 2) if sieve[i]]
    a = pi(400)
    b = range(100000)
    y = str(a)
    for x in b:
        if str(x) in y:
            y = y.replace(str(x), " ", 1)#replace first occurrence only
    while "  " in y:
        y = y.replace("  ", " ")#replace long chains of spaces with a single space
    z = y.split(" ")#split terms into a list
    z = filter(None, z)#remove null terms
    f = list(map(int, z))#convert to integers
    print(f[0:-1])
    # Code for A245770 by David Consiglio, Jr., Jan 03 2015
    # Modified by Manfred Scheucher,  Jun 05 2015

Extensions

Corrected and extended by Manfred Scheucher, Jun 05 2015

A257835 Whole number sieve of e.

Original entry on oeis.org

28, 2, 2, 5, 6, 9, 24, 9, 9, 57, 9, 6, 6, 3, 5, 2, 6, 27, 6, 3, 0, 99, 7, 35, 6, 0, 0, 59, 30, 28, 4, 6, 33, 75, 25, 4, 0, 40, 7, 6, 8, 4, 5, 4, 7, 5, 5, 70, 0, 4, 75, 49, 2, 3, 9, 7, 3, 4, 15, 6, 25, 9, 44, 5, 0, 4, 6, 6, 9, 3, 2, 99, 35, 2, 33, 5, 69, 8, 62, 30, 8
Offset: 1

Views

Author

Manfred Scheucher, Jun 05 2015

Keywords

Comments

Find the first occurrence of 0 (the first whole number) in the digits of e (only 35 digits in this illustration):
27182818284590452353602874713526625..., and replace it with a space:
2718281828459 452353602874713526625... Repeat the process with the next whole number, 1:
27 8281828459 452353602874713526625... Then 2:
7 8281828459 452353602874713526625... Then 3:
7 8281828459 452 53602874713526625... Then 4,5,6,7, etc., until the first occurrence of every counting number is eliminated from the digits of e.
28 2 02 5 6 ... Then consolidate gaps between the remaining digits into a single comma:
28,2,2,5,6,9,24,9,9,57,9,6,6,3,5,2,... to produce the first terms in the whole number sieve of e.

Crossrefs

A258481 Whole number sieve of Phi.

Original entry on oeis.org

1, 3, 9, 48, 4, 8, 9, 9, 6, 5, 5, 0, 28, 70, 0, 89, 11, 48, 5, 8, 7, 8, 53, 3, 0, 26, 4, 6, 5, 9, 5, 8, 26, 3, 6, 20, 9, 1, 3, 43, 6, 86, 43, 4, 0, 0, 80, 7, 4, 4, 9, 1, 3, 86, 4, 77, 4, 70, 8, 74, 4, 2, 7, 6, 9, 88, 74, 7, 57, 8, 4, 0, 0, 28, 4, 62, 3, 4, 170, 6, 69, 87, 2
Offset: 1

Views

Author

Manfred Scheucher, Jun 05 2015

Keywords

Examples

			Find the first occurrence of 0 (the first whole number) in the digits of Phi (only 35 digits in this illustration):
16180339887498948482045868343656381..., and replace it with a space:
1618 339887498948482045868343656381...  Repeat the process with the next whole number, 1:
618 339887498948482045868343656381...  Then 2:
618 33988749894848 045868343656381...  Then 3:
618  3988749894848 045868343656381...  Then 4,5,6,7, etc., until the first occurrence of every counting number is eliminated from the digits of Phi.
  1   3     9    48 04 8           ...  Then consolidate gaps between the remaining digits into a single comma:
1,3,9,48,4,8,9,9,6,5,5,0,28,70,0,  ...  to produce the first terms in the whole number sieve of Phi.
		

Crossrefs

Showing 1-3 of 3 results.