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.

User: Christopher J. Hanson

Christopher J. Hanson's wiki page.

Christopher J. Hanson has authored 14 sequences. Here are the ten most recent ones:

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

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

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

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

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

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

A236186 Differences between terms of compacting Eratosthenes sieve for prime(5) = 11.

Original entry on oeis.org

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

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

Essentially the same as A049296.

Programs

  • PARI
    {a(n) = my(A); if( n<1, 0, A = vector( n*50 + 148, k, k+1); for( i = 1, 4, A = select( k -> k%prime(i), A) ); polcoeff( (1 - x) * Ser( select( k -> k>11 && (k%11) == 0, A) / 11), n))}; /* Michael Somos, Mar 10 2014 */

Formula

a(n + 48) = a(n). - Michael Somos, Mar 10 2014

Extensions

Made sequence periodic. - Michael Somos, Mar 10 2014

A236185 Differences between terms of compacting Eratosthenes sieve for prime(4) = 7.

Original entry on oeis.org

4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2, 4, 6, 2
Offset: 1

Author

Christopher J. Hanson, Jan 21 2014

Keywords

Comments

P(x) is a function which represents a prime number at a ordinal x.
This pattern, dp(x) is a sequence of the differences between consecutive prime numbers as described by p(x).
For P(4), dp(4)is the relative offsets of the next 7 primes: 7, +4 = 11, +2 = 13, +4 = 17, +2 = 19, +4 = 23, +6 = 29, +2 = 31
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 this sequence. - Michael Somos, Mar 12 2014

Crossrefs

Cf. A007775. Essentially the same as A145011.

Programs

  • PARI
    {a(n) = my(A); if( n<1, 0, A = vector( n*28 + 48, k, k+1); for( i = 1, 3, A = select( k -> k%prime(i), A) ); polcoeff( (1 - x) * Ser( select( k -> k>7 && (k%7) == 0, A) / 7), n)) }; /* Michael Somos, Mar 10 2014 */
    (C#)
    // dp(4) = GeneratePrimeDifferencialPattern( 4 );
    static void GeneratePrimeDifferencialPattern( 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;
            int count = 0;
            bool counting = true;
            // 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 )
                {
                    // Add skip count to pattern
                    pattern.Add( numberLine[index] );
                    // Mark as not prime
                    numberLine[index] = 0;
                    // Reset skips
                    if( counting )
                    {
                        count++;
                        if( skips <= 2 )
                            counting = false;
                    }
                    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 prime = numberLine[ordinal-1];
                var d = pattern.Take( count ).ToArray();
                List dp = new List();
                for( int y = 1; y < count; y++ )
                    dp.Add( ( d[y] - d[y - 1] ) / prime );
                System.Console.WriteLine( "Pattern P({0}) = {1} :: dp({0}) = {2}", pointer + 1, numberLine[pointer], String.Join( ", ", dp ) );
                return;
            }
            // Move number-line pointer forward
            pointer++;
        }
    }

Formula

a(n + 8) = a(n). - Michael Somos, Mar 10 2014
a(n) = 4*((n+2) mod 2) + 2*((n+1) mod 2) + 4*(f(8,n+2)+f(8,n)) - 2*f(8,n+1), where f(x,n)= floor(n/x)-floor((n-1)/x). - Gary Detlefs, Nov 16 2020

Extensions

Edited by Michael Somos, Mar 12 2014. (Added code and comments, refined description.)

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

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

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

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

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

Author

Christopher J. Hanson, Jan 19 2014

Keywords

Comments

See A236175 for details.

Crossrefs