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.

A212037 The size of the set of numbers k>=0 such that all (2^n+k)*2^n-1 are prime but only the last (largest) (2^n+k)*2^n+1 is also an associated twin prime.

Original entry on oeis.org

1, 6, 1, 4, 2, 2, 2, 24, 6, 2, 28, 7, 16, 47, 29, 6, 41, 16, 3, 17, 32, 10, 10, 23, 14, 15, 52, 4, 13, 20, 23, 4, 84, 26, 88, 50, 20, 35, 51, 44, 41, 87, 1, 142, 13, 188, 107, 162, 91, 96, 197, 4, 148, 71, 9, 66, 97, 41, 10, 9, 152, 234, 48, 104, 144, 40, 18, 45, 52, 204, 21, 49, 51, 9, 102, 13, 31, 108, 88
Offset: 1

Views

Author

Pierre CAMI, Jul 14 2012

Keywords

Comments

Starting at a count of zero, we consider for increasing k>=0 the pairs (2^n+k)*2^n+-1. If the smaller of these two numbers is prime, we increase the counter. If the larger of these two numbers is also prime, we admit the counter to the sequence. It is basically a measure of how many unsuccessful primality tests on the larger of the two numbers are done before it becomes a compatible twin prime.
Heuristically, the average of a(n)/n over n=1 to N tends to 1 as N increases.

Examples

			For n=2, the 6 pairs (19,21) at k=1, (23,25) at k=2, (31,33) at k=4, (43,45) at k=7, (47,49) at k=8 and (59,61) at k=11 are counted. The smaller of these must be a prime to be counted, and at k=11 also the larger (i.e., 61) becomes prime, which finishes the search.
		

Crossrefs

Programs

  • Maple
    A212037 := proc(n)
        local a,k,p ;
        a := 0 ;
        for k from 0 do
            p := (2^n+k)*2^n-1 ;
            if isprime(p) then
                a := a+1 ;
            end if;
            if isprime(p) and isprime(p+2) then
                return a;
            end if;
        end do:
    end proc: # R. J. Mathar, Jul 20 2012