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-10 of 11 results. Next

A236175 Prime gap pattern of compacting Eratosthenes sieve for prime(4) = 7.

Original entry on oeis.org

11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, 6, 3, 6, 11, 2
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

P(x) is a function which produces a prime number at a particular ordinal x (A000040). This pattern, p(x), describes the number of values emitted as potentially prime by a reductive sieve before a value is marked "not prime" when processing the prime at ordinal x. p(x) represents only the unique portion of the pattern and terminates when the pattern repeats. The first digit of p(x) corresponds to A079047 for index x.
In this sequence, x = 4 and thus a(1) = A079047(4) = 11. - Michael Somos, Mar 09 2014
The Eratosthenes sieve can be expressed as follows. Start with S1 = [2, 3, 4, 5, ...] the list of numbers bigger than 1. Removing all multiples of the first element 2 yields the list S2 = [3, 5, 7, 9, ...]. Removing all multiples of the first element 3 yields S3 = [5, 7, 11, 13, 17, 19, ...], Removing all multiples of the first element 5 yields S4 = [7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 49, ...], and so on. The list of first differences of S4 is [4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, ...] which is A236185. The list of indices of all multiples of S4(1) = 7 is [1, 13, 20, 24, 31, 35, 42, 54, 57, 69, 76, 80, ...]. The list of first differences of this list is [12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, ...]. Subtract one from each element yields [11, 6, 3, 6, 3, 6, 11, 2, 11, 6, 3, ...] which is this sequence. - Michael Somos, Mar 12 2014

Crossrefs

Equivalent sequences for prime(k): A236176 (k=5), A236177 (k=6), A236178 (k=7), A236179 (k=8), A236180 (k=9).

Programs

  • Mathematica
    PadRight[{}, 100, {11, 6, 3, 6, 3, 6, 11, 2}] (* Paolo Xausa, Jun 30 2024 *)
  • PARI
    {a(n) = my(A); if( n<1, 0, A = vector( (n+1) * 1024 \ 37, k, k+1); for( i = 1, 3, A = select( k -> k%prime(i), A) ); polcoeff( (1 - x) * Ser( select( k -> (k%7) == 0, A, 1)), n) - 1) }; /* Michael Somos, Mar 09 2014 */
    (C#)
    // p(4) = GeneratePrimePattern( 4 );
    static void GeneratePrimePattern( int ordinal )
    {
        // Contract
        if( ordinal < 1 )
            throw new ArgumentOutOfRangeException( "ordinal" );
        // Local data
        int size = 1 << 18;
        int[] numberLine = Enumerable.Range( 2, size ).ToArray();
        int pointer = 0;
        // Apply sieve: for each integer greater than 1
        while( pointer < numberLine.Length )
        {
            // Locals
            int x = numberLine[pointer];
            int index = pointer;
            List pattern = new List();
            int skips = 0;
            // Find all products
            for( int n = x + x; n < size; n += x )
            {
                // Fast forward through number-line
                while( numberLine[++index] < n )
                    skips++;
                // If the number was not already removed
                if( numberLine[index] == n )
                {
                    // Mark as not prime
                    numberLine[index] = 0;
                    // Add skip count to pattern
                    pattern.Add( skips );
                    // Reset skips
                    skips = 0;
                }
                // Otherwise we've skipped again
                else skips++;
            }
            // Reduce number-line
            numberLine = numberLine.Where( n => n > 0 ).ToArray();
            // If we have a pattern we want
            if( pattern.Any() && pointer == ordinal - 1 )
            {
                // Report pattern
                int previousValue = 3; // > 2
                System.Console.WriteLine( "Pattern P({0}) = {1} :: p({0}) = {2}", pointer + 1, numberLine[pointer], String.Join( ", ", pattern.TakeWhile( value => previousValue > 2 && ( previousValue = value ) > 0 ) ) );
                return;
            }
            // Move number-line pointer forward
            pointer++;
        }
    }

Formula

a(n + 8) = a(n). - Michael Somos, Mar 09 2014
a(n) = A359632(n) - 1. - Peter Munn, Jan 21 2023

Extensions

Edited by Michael Somos, Mar 09 2014. Made sequence periodic.

A236180 Prime gap pattern of compacting Eratosthenes sieve for prime(9) = 23.

Original entry on oeis.org

90, 22, 6, 20, 15, 7, 15, 21, 21, 7, 23, 17, 6, 22, 15, 21, 29, 17, 6, 17, 7, 13, 55, 15, 21, 8, 37, 8, 23, 23, 14, 24, 21, 8, 39, 6, 16, 6, 46, 46, 14, 7, 14, 22, 9, 39, 24, 21, 24, 8, 23, 13, 8, 39, 54, 14, 7, 14, 55, 22, 38, 7, 15, 24, 28, 22, 25, 14, 22
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs

A236190 Differences between terms of compacting Eratosthenes sieve for prime(9) = 23.

Original entry on oeis.org

6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4, 2, 4
Offset: 1

Views

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a particular ordinal x. This pattern, dp(x), describes the difference between consecutive prime numbers as described by p(x) (see A236175) and therefore the length of dp(x) is len(p(x)) - 1 and each value in dp(x) times P(x) is the difference between values determined not primed when running one pass of a reductive sieve, starting at P(x)^2. See A236185.

Crossrefs

A236177 Prime gap pattern of compacting Eratosthenes sieve for prime(6) = 13.

Original entry on oeis.org

33, 8, 6, 10, 14, 6, 14, 10, 4, 10, 15, 15, 4, 16, 10, 5, 15, 10, 15, 20, 11, 4, 10, 4, 10, 37, 10, 15, 4, 27, 5, 14, 15, 9, 3, 11, 15, 6, 26, 5, 9, 4, 31, 26, 4, 10, 5, 10, 14, 5, 16, 10, 15, 16, 13, 4, 17, 10, 5, 14, 11, 14, 21, 10, 5, 9, 15, 20, 16, 24, 5
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs

A236178 Prime gap pattern of compacting Eratosthenes sieve for prime(7) = 17.

Original entry on oeis.org

54, 5, 12, 18, 5, 18, 12, 6, 11, 20, 17, 7, 18, 11, 7, 18, 12, 19, 26, 12, 6, 11, 6, 13, 44, 10, 19, 6, 31, 6, 18, 20, 13, 19, 17, 5, 31, 6, 14, 5, 37, 38, 13, 5, 13, 19, 5, 32, 18, 20, 17, 7, 18, 11, 6, 19, 10, 44, 13, 5, 13, 18, 26, 19, 31, 7, 11, 18, 7
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs

A236179 Prime gap pattern of compacting Eratosthenes sieve for prime(8) = 19.

Original entry on oeis.org

64, 12, 18, 6, 20, 12, 4, 15, 18, 21, 5, 18, 13, 7, 20, 12, 20, 25, 14, 6, 13, 6, 14, 46, 13, 18, 6, 34, 7, 18, 19, 14, 18, 21, 6, 34, 5, 15, 6, 39, 40, 13, 7, 12, 19, 7, 33, 19, 17, 21, 7, 19, 12, 6, 35, 46, 14, 6, 11, 49, 20, 33, 4, 15, 16, 7, 21, 21, 19, 11
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs

A236176 Prime gap pattern of compacting Eratosthenes sieve for prime(5) = 11.

Original entry on oeis.org

25, 4, 9, 4, 10, 14, 3, 15, 9, 4, 8, 14, 15, 4, 14, 9, 4, 14, 10, 13, 19, 10, 4, 8, 4, 10, 19, 13, 10, 14, 4, 9, 14, 4, 15, 14, 8, 4, 9, 15, 3, 14, 10, 4, 9, 4, 25, 2
Offset: 1

Views

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs

A236187 Differences between terms of compacting Eratosthenes sieve for prime(6) = 13.

Original entry on oeis.org

4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 10, 2, 4, 2, 4, 6, 2, 6, 4, 6, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 6, 8, 6, 10, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6
Offset: 1

Views

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a particular ordinal x. This pattern, dp(x), describes the difference between consecutive prime numbers as described by p(x) (see A236175) and therefore the length of dp(x) is len(p(x)) - 1 and each value in dp(x) times P(x) is the difference between values determined not primed when running one pass of a reductive sieve, starting at P(x)^2. See A236185.

Crossrefs

A236188 Differences between terms of compacting Eratosthenes sieve for prime(7) = 17.

Original entry on oeis.org

2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 6, 4, 14, 4, 2, 4, 6, 8, 6, 10, 2, 4, 6, 2, 6, 6, 6, 4, 6, 2, 6, 4, 8, 10, 2, 10, 2, 4
Offset: 1

Views

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a particular ordinal x. This pattern, dp(x), describes the difference between consecutive prime numbers as described by p(x) (see A236175) and therefore the length of dp(x) is len(p(x)) - 1 and each value in dp(x) times P(x) is the difference between values determined not primed when running one pass of a reductive sieve, starting at P(x)^2. See A236185.

Crossrefs

A236189 Differences between terms of compacting Eratosthenes sieve for prime(8) = 19.

Original entry on oeis.org

4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 2, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 4, 2, 4, 6, 8
Offset: 1

Views

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a particular ordinal x. This pattern, dp(x), describes the difference between consecutive prime numbers as described by p(x) (see A236175) and therefore the length of dp(x) is len(p(x)) - 1 and each value in dp(x) times P(x) is the difference between values determined not primed when running one pass of a reductive sieve, starting at P(x)^2. See A236185.

Crossrefs

Showing 1-10 of 11 results. Next