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

A258640 Whole number sieve of square root of 2.

Original entry on oeis.org

1, 3, 4, 8, 9, 80, 9, 69, 0, 7, 7, 8, 2, 0, 5, 3, 7, 0, 9, 0, 8, 37, 4, 0, 55, 75, 99, 50, 7, 0, 5, 97, 27, 9, 1, 9, 8, 55, 9, 48, 87, 2, 8, 36, 95, 79, 25, 3, 88, 20, 5, 47, 8, 6, 37, 70, 54, 60, 8, 8, 60, 4, 50, 0, 5, 2, 6, 0, 7, 130, 18, 86, 2, 34
Offset: 1

Views

Author

Manfred Scheucher, Jun 06 2015

Keywords

Examples

			Find the first occurrence of 0 (the first whole number) in the digits of sqrt(2) (only 35 digits in this illustration):
14142135623730950488016887242096980..., and replace it with a space:
1414213562373 950488016887242096980...  Repeat the process with the next whole number, 1:
414213562373 950488016887242096980...  Then 2:
414 13562373 950488016887242096980...  Then 3:
414 1 562373 950488016887242096980...  Then 4,5,6,7, etc., until the first occurrence of every counting number is eliminated from the digits of sqrt(2).
     1      3    4     8      9    ...  Then consolidate gaps between the remaining digits into a single comma:
1,3,4,8,9,80,9,69,0,7,7,8,2,0,5,3, ...  to produce the first terms in the whole number sieve of sqrt(2).
		

Crossrefs

Showing 1-3 of 3 results.