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.

A205321 Smallest k>=0 such that (2^n+k)*2^n-1 and (2^n+k)*2^n+1 are a twin prime pair.

Original entry on oeis.org

0, 11, 1, 11, 4, 11, 13, 116, 34, 14, 241, 44, 97, 458, 337, 59, 604, 206, 67, 167, 424, 179, 97, 326, 259, 284, 1177, 77, 328, 356, 508, 74, 1798, 749, 2197, 1289, 643, 839, 1171, 1427, 814, 2564, 31, 4244, 379, 5099, 3706, 4871, 2719, 3194, 7057, 122, 5329, 2636, 301, 2852, 3793
Offset: 1

Views

Author

Pierre CAMI, Jul 14 2012

Keywords

Comments

Conjecture : there is at least one k for each n.

Crossrefs

Programs

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

Formula

a(n) = A082466(2^n), n>1. - R. J. Mathar, Jul 20 2012

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

Original entry on oeis.org

1, 7, 5, 2, 4, 11, 6, 1, 3, 2, 31, 2, 11, 11, 11, 6, 30, 16, 2, 36, 90, 56, 11, 52, 13, 36, 10, 62, 20, 31, 23, 28, 30, 14, 47, 22, 10, 5, 104, 39, 11, 14, 64, 184, 209, 176, 193, 162, 25, 38, 23, 5, 27, 157, 5, 17, 32, 90, 1, 199, 96, 83, 29, 82, 12, 220, 19, 40, 37, 13, 16, 120, 11, 130, 12, 77, 202
Offset: 4

Views

Author

Pierre CAMI, Jul 14 2012

Keywords

Comments

Search set similar to A212037 but the sign of k in the prime form is switched.
Heuristically the average of a(n)/n for n=1 to N tends to 1 as N increases.

Crossrefs

Programs

  • Maple
    A212038 := 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 21 2012
  • PFGW
    SCRIPT
    DIM nn, 3
    DIM jj
    DIM kk
    DIMS tt
    OPENFILEOUT myfile, a(n).txt
    LABEL loopn
    SET nn, nn+1
    IF nn>825 THEN END
    SET kk, -1
    SET jj, 0
    LABEL loopk
    SET kk, kk+1
    SETS tt, %d, %d\,; nn; kk
    PRP (2^nn-kk)*2^nn-1, tt
    IF ISPRP THEN GOTO a
    IF ISPRIME THEN GOTO a
    GOTO loopk
    LABEL a
    SET jj, jj+1
    PRP (2^nn-kk)*2^nn+1, tt
    IF ISPRP THEN GOTO d
    IF ISPRIME THEN GOTO d
    GOTO loopk
    LABEL d
    SETS tt, %d, %d\,; nn; jj
    WRITE myfile, tt
    GOTO loopn

A216217 Smallest k such that 6^n - 2*k*3^n - 1 and 6^n - 2*k*3^n + 1 are twin primes or 0 if no solution, n > 1.

Original entry on oeis.org

1, 2, 3, 0, 3, 11, 33, 9, 26, 6, 34, 138, 51, 19, 33, 246, 66, 31, 167, 73, 13, 716, 138, 148, 138, 339, 447, 41, 131, 41, 9, 178, 778, 337, 543, 2154, 213, 1216, 454, 183, 678, 442, 157, 381, 297, 1476, 54, 1201, 1942, 1566, 572, 3708, 3261, 3672, 1087, 306
Offset: 2

Views

Author

Pierre CAMI, Mar 13 2013

Keywords

Comments

Conjecture: there is only one zero term: a(5) = 0.
The PFGW script computes 2*a(n).

Examples

			6^2 - 2*1*3^2 - 1 = 17, 17 and 19 twin primes so a(2)=1.
6^3 - 2*2*3^3 - 1 = 107, 107 and 109 twin primes so a(3)=2.
6^4 - 2*3*3^4 - 1 = 809, 809 and 811 twin primes so a(4)=3.
6^5 - 2*k*3^5 - 1 and 6^5 - 2*k*3^5 + 1 for k=1 to 30 have no twin prime solution so a(5)=0.
		

Crossrefs

Cf. A205322 (similar, but powers of 2).

Programs

  • Mathematica
    Table[k = 0; While[k++; p = 6^n - 2*k*3^n - 1; p > 0 && ! (PrimeQ[p] && PrimeQ[p + 2])]; If[p <= 0, 0, k], {n, 2, 50}] (* T. D. Noe, Mar 15 2013 *)
Showing 1-3 of 3 results.