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

A248804 Prime sieve of e.

Original entry on oeis.org

18, 8284, 90452, 60287, 526624, 24, 36999, 669, 6, 24076630, 5945, 382, 85, 6, 427, 9, 3, 0, 2, 7, 66, 0, 57, 429526059, 0, 813, 2862, 4, 763, 5, 9525, 90, 573, 4, 21540, 934884, 46066808, 6847, 85, 4234544, 53, 77, 9, 551702, 8386062, 8, 7520, 38265, 760, 7
Offset: 1

Views

Author

Jared Kish, Oct 14 2014

Keywords

Crossrefs

Cf. A001113, A245770 (prime sieve of Pi), A248831 (prime sieve of sqrt(2)).

Programs

  • Python
    from decimal import *
    getcontext().prec = 300
    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]]
    b = primes(429526060)
    x = (Decimal(1).exp())
    y = str(x).replace(".","")
    for x in b:
        y = y.replace(str(x)," ",1) #replace first occurrence only
    f = [int(x) for x in y.split()[:-1]]
    print(f)
    # David Consiglio, Jr., Jan 03 2015

Extensions

More terms from David Consiglio, Jr., Jan 03 2015
More terms from Manfred Scheucher, May 25 2015

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

A248831 Prime sieve of the square root of 2.

Original entry on oeis.org

1, 4, 1, 6, 309, 6, 8078, 1875, 69480, 66, 7, 32, 8462, 388, 87, 2764, 27350, 846, 12, 24, 6055850, 4, 999358, 41322266, 27505, 9995050, 527820605, 470, 5, 716059, 453459686, 285, 86408, 5, 87, 4508, 627995, 8968, 396546, 808, 640620, 5, 50, 502, 599, 2
Offset: 1

Views

Author

Jared Kish, Oct 15 2014

Keywords

Comments

Algorithm: see A245770 (prime sieve of Pi).

Crossrefs

Cf. A002193 (square root of 2), A245770 (prime sieve of Pi), A248804 (prime sieve of e).

Programs

  • Python
    def sqroot(a, digits):
        a = a * (10**(2*digits))
        x_prev = 0
        x_next = 1 * (10**digits)
        while x_prev != x_next:
            x_prev = x_next
            x_next = (x_prev + (a // x_prev)) >> 1
        return x_next
    def 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 = sqroot(2,300)#300 digits is arbitrary - lengthen for more digits
    b = primes(10000000)#make sure to scan primes up to longest term in sequence
    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 chains of spaces with a single space
    z = y.split(" ")#split terms into a list
    z = filter(None, z)#remove null terms
    f = map(int,z)#convert to integers
    print(f)
    # David Consiglio, Jr., Jan 03 2015

Extensions

More terms from David Consiglio, Jr., Dec 02 2014, Jan 03 2015
More terms from Manfred Scheucher, May 25 2015

A247861 Prime sieve of Phi.

Original entry on oeis.org

1, 80, 3988, 49, 4848, 4, 86, 6, 8, 7720309, 62862, 54486, 526046, 890244, 0, 20, 893, 48, 540, 17, 38622, 5369, 31800, 6, 54, 86, 958, 56, 226, 92, 0, 5, 2501, 3, 43216, 548626296, 61, 8, 7, 1, 40805, 9544, 492, 8, 5364864, 443, 344, 495658, 88, 8, 39, 254, 706, 15884607, 88712, 5, 7, 41662, 40, 0, 2, 7, 77, 15, 14, 1704666
Offset: 1

Views

Author

Gil Broussard, Sep 25 2014

Keywords

Examples

			Find the first occurrence of prime 2 in the digits of Phi (only 40 digits in this illustration):
161803398874989484820458683436563811772..., and replace it with a space:
1618033988749894848 0458683436563811772...  Repeat the process with 3:
16180 3988749894848 0458683436563811772...  Then 5:
16180 3988749894848 04 8683436563811772...  Then 7:
16180 3988 49894848 04 8683436563811772...  Then 11, 13, 17, etc., until the first occurrence of every prime is eliminated from the digits of Phi.
1  80 3988 49  4848 04 86    6   8  772...  Then consolidate gaps between the remaining digits into a single comma:
1,80,3988,49,4848,4,86,6,8,7720309,...      to produce the first terms in the prime sieve of Phi.
		

Crossrefs

Extensions

Corrected and extended by Manfred Scheucher, Jun 05 2015

A246022 Prime sieve of Champernowne constant A033307.

Original entry on oeis.org

1, 4, 6, 10, 12, 1, 516, 18, 202122, 242, 28, 30, 3, 3, 6, 3, 94041, 444546, 4849, 52535455, 58, 60, 6, 646566, 686, 0, 72, 74, 78, 8, 848, 888990, 9495, 98, 0, 102, 104, 6, 108, 1, 112, 1141, 16, 201, 22, 26, 1, 29130, 3, 4, 6, 138, 1, 411, 44, 47148, 150, 531
Offset: 1

Views

Author

N. J. A. Sloane, Aug 14 2014

Keywords

Comments

Start with the decimal expansion of the Champernowne constant A033307:
12345678910111213141516171819202122232425262728293031323334353637383940\
4142434445464748495051525354555657...
Find the first occurrence of the prime 2 and replace it with a space:
1 3456789101112131415161718192021222324252627282930...
1 456789101112131415161718192021222324252627282930... Repeat the process with 3
1 4 6789101112131415161718192021222324252627282930... Then 5
1 4 6 89101112131415161718192021222324252627282930... Then 7
1 4 6 8910 12 141516 18 202122 24252627282930... Then 11, 13, 17, etc., until the first occurrence of every prime is eliminated. 89, 41, 52627, will disappear.
Then consolidate gaps between the remaining digits into a single comma:
1, 4, 6, 10, 12, 1, 516, 18, 202122, 242, 28, 30, 3, 3, 6, ...

Crossrefs

Suggested by A245770, A248804, A247861. Cf. A033307, A007376.

Extensions

More terms from Manfred Scheucher, Jun 05 2015

A318708 Terms resulting from application of a prime sieve to the digits of the decimal expansions of the positive integers.

Original entry on oeis.org

1, 4, 6, 8, 9, 10, 1, 1, 14, 1, 16, 1, 18, 0, 1, 4, 6, 8, 9, 0, 1, 4, 6, 8, 9, 40, 4, 4, 44, 4, 46, 4, 48, 49, 0, 1, 4, 6, 8, 9, 60, 6, 6, 64, 6, 66, 6, 68, 69, 0, 1, 4, 6, 8, 9, 80, 81, 8, 8, 84, 8, 86, 8, 88, 90, 91, 9, 9, 94, 9, 96, 9, 98, 99, 100, 10, 10, 104, 10, 106, 10, 108, 0, 1, 4
Offset: 1

Views

Author

Ctibor O. Zizka, Sep 01 2018

Keywords

Comments

Definition of sieving over the digits of k: Erase each digit 2 in the decimal expansion of k, then consolidate the remaining digits. Erase each digit 3 in what remains from the previous step, then consolidate the remaining digits. Repeat the procedure with 5, 7, ..., largest prime <= last consolidated remainder. What remains then becomes a term of the sequence. If there are no remaining digits after the procedure, this number disappears and is not a term.
Consolidation means the removal of all empty places at each step of the sieving process. Example: k = 1225; erasing all 2's in 1225 results in 1__5, which consolidates to 15; erasing all 3's in 15 results in 15; erasing all 5's in 15 results in 1_, which consolidates to 1. So for k = 1225 the result after sieving is 1. Example: k = 10101; erasing all 2's, ..., 97's results in 10101; erasing 101's in 10101 results in ___01, which consolidates to the last consolidated remainder 01. As there is no prime <= 01 to sieve with, the result for k = 10101 after sieving is 1.
Largest number of a sieve <= last consolidated remainder.
This sequence sieve is: {primes}. There could be other sieve definitions: {binary numbers}, {even numbers}, {odd numbers}, {triangular numbers}, predefined set of numbers like {0,3,11,27}, etc.

Examples

			n = 113
p_1 = 2, no occurrence of 2 in 113
p_2 = 3, 1 occurrence of 3 in 113, erase 3, remains 11
p_3 = 5, no occurrence of 5 in 11
p_4 = 7, no occurrence of 7 in 11
p_5 = 11, 1 occurrence of 11 in 11, no remainder
number 113 disappears and is not a member of the seq.
n = 114
p_1 = 2, no occurrence of 2 in 114
p_2 = 3, no occurrence of 3 in 114
p_3 = 5, no occurrence of 5 in 114
p_4 = 7, no occurrence of 7 in 114
p_5 = 11, 1 occurrence of 11 in 114, erase 11, remains 4
number 4 is a member of the seq.
		

Crossrefs

Programs

  • Mathematica
    upto[n_] := Block[{s = ToString /@ Range[n]}, Do[s = StringReplace[s, ToString[p] -> ""], {p, Prime@ Range@ PrimePi@ n}]; ToExpression@ DeleteCases[s, ""]]; upto[115] (* Giovanni Resta, Sep 01 2018 *)
Showing 1-6 of 6 results.