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.

Previous Showing 21-28 of 28 results.

A133830 Least positive number k < n such that the binary trinomial 1 + 2^n + 2^k is prime, or 0 if there is no such k.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 0, 3, 3, 2, 1, 4, 5, 1, 1, 11, 1, 6, 5, 4, 7, 3, 9, 0, 17, 15, 1, 15, 1, 6, 0, 4, 9, 14, 13, 3, 11, 25, 0, 6, 7, 0, 17, 7, 15, 2, 0, 30, 23, 6, 21, 2, 33, 1, 0, 3, 0, 14, 5, 6, 21, 19, 0, 30, 3, 1, 5, 34, 19, 26, 17, 19, 17, 5, 33, 15, 23, 27, 33, 4, 3, 26, 1, 39, 35, 19, 9, 18
Offset: 2

Views

Author

T. D. Noe, Sep 26 2007

Keywords

Comments

Sequence A081504 gives the n such that a(n) = 0. For those n, A133831(n) gives the least k > n for which the binary trinomial is prime.

Crossrefs

Cf. A057732, A059242, A057196, A057200, A081091 (various forms of prime binary trinomials).
Cf. A095056, A133831, A133832 (k > n equivalent).

Programs

  • Mathematica
    Table[s=1+2^n; k=1; While[k
    				

Extensions

Edited by Peter Munn, Sep 30 2024

A133831 Least positive number k != n such that the binary trinomial 1 + 2^n + 2^k is prime, or 0 if there is no such k.

Original entry on oeis.org

2, 1, 1, 1, 2, 1, 1, 9, 3, 3, 2, 1, 4, 5, 1, 1, 11, 1, 6, 5, 4, 7, 3, 9, 27, 17, 15, 1, 15, 1, 6, 458465, 4, 9, 14, 13, 3, 11, 25, 57, 6, 7, 46, 17, 7, 15, 2, 1009, 30, 23, 6, 21, 2, 33, 1, 1265, 3, 69, 14, 5, 6, 21, 19, 2241, 30, 3, 1, 5, 34, 19, 26, 17, 19, 17, 5, 33, 15, 23, 27
Offset: 1

Views

Author

T. D. Noe, Sep 26 2007

Keywords

Comments

Does such k exist (so that a(n) is nonzero) for all n? These binary trinomials can also be written as f*2^n+1, where f=2^m+1 for some m, which is reminiscent of the Sierpinski problem (see A076336). Hence if there are no Sierpinski numbers of the form 2^m+1, then a(n) is nonzero for all n.
The PFGW program was used to find a(32), which produces a 138012-digit probable prime. If a(256) is nonzero, it is greater than 10^6.

Crossrefs

Cf. A057732, A059242, A057196, A057200, A081091 (various forms of prime binary trinomials).
Closely related problems: A040076 (see also A076336), A067760, A133830 (k < n), A133832 (k > n).
Cf. A095056.

Programs

  • Mathematica
    mx=4000; Table[s=1+2^n; k=1; While[k==n || (k
    				

Extensions

Edited by Peter Munn, Sep 29 2024

A133832 Least number k > n such that the binary trinomial 1 + 2^n + 2^k is prime, or 0 if there is no such k.

Original entry on oeis.org

2, 3, 5, 13, 6, 7, 9, 9, 18, 19, 14, 13, 15, 17, 17, 81, 20, 19, 30, 33, 26, 27, 38, 81, 27, 35, 31, 33, 35, 31, 42, 458465, 36, 45, 47, 37, 67, 53, 41, 57, 42, 45, 46, 69, 54, 57, 53, 1009, 100, 119, 55, 73, 83, 67, 57, 1265, 74, 69, 66, 113, 75, 101, 66, 2241, 68, 67, 70
Offset: 1

Views

Author

T. D. Noe, Sep 26 2007

Keywords

Comments

Conjecture: a(n) is nonzero for all n. These binary trinomials can also be written as f*2^n+1, where f=2^m+1 for some m, which is reminiscent of the Sierpinski problem (see A076336). The conjecture is equivalent to no Sierpinski numbers of the form 2^m+1 existing.
The PFGW program was used to find a(32), which produces a 138012-digit probable prime.

Crossrefs

Cf. A057732, A059242, A057196, A057200, A081091 (various forms of prime binary trinomials).
Cf. A095056, A133830 (k < n equivalent), A133831.

Programs

  • Mathematica
    mx=4000; Table[s=1+2^n; k=n+1; While[k
    				

Extensions

Edited by Peter Munn, Sep 29 2024

A296806 Take a prime, convert it to base 2, remove its most significant digit and its least significant digit and convert it back to base 10. Sequence lists primes that generate another prime by this process.

Original entry on oeis.org

13, 23, 31, 37, 43, 47, 59, 71, 79, 103, 127, 139, 151, 163, 167, 191, 211, 223, 251, 263, 271, 283, 331, 379, 463, 523, 547, 571, 587, 599, 607, 619, 631, 647, 659, 691, 719, 727, 739, 787, 811, 827, 839, 859, 907, 911, 967, 971, 991, 1031, 1039, 1051, 1063, 1087
Offset: 1

Views

Author

Paolo P. Lava, Paolo Iachia, Dec 21 2017

Keywords

Comments

From an idea of Ken Abbott (see link).
From Paolo Iachia, Dec 21 2017: (Start)
Let us call these numbers "core of a prime".
Let C(q) be the core of a prime q.
Then C(q) = (q - 2^floor(log_2(q)) - 1)/2.
Examples: C(59) = (59 - 2^5 - 1)/2 = 13; C(71) = (71 - 2^6 - 1)/2 = 3; C(73) = (73 - 2^6 - 1)/2 = 4; C(251) = (251 - 2^7 - 1)/2 = 61.
0 <= C(q) <= 2^(floor(log_2(q)) - 1) - 1. The minimum (0) occurs when q = 2^n+1, with n > 2. Example: 17 = 2^4+1, C(17) = (17 - 2^4 - 1)/2 = 0. The maximum is reached when q = 2^n-1 is a Mersenne prime. Example: 127 = 2^7 - 1, C(127) = (127 - 2^6 - 1)/2 = 31 = 2^5 - 1.
The last example is particularly interesting, as both the prime q and its core are Mersenne primes. The same holds for C(31) = 7 and for C(524247) = 131071, with 524247 = 2^19-1 and 131071 = 2^17-1, both Mersenne primes. Are there more such cases?
Note that the core of Mersenne number (prime or not) is a Mersenne number by definition. Counterexamples include C(8191) = 2047, with 8191 = 2^13 - 1, a Mersenne prime, but 2047 = 2^11 - 1 = 23*89, a Mersenne number not prime, and C(131071) = 32767 = 2^15 - 1 = 7*31*151, with 2 of its factors being Mersenne primes.
Primes whose binary expansion is of the form q = 1 0 ... 0 c_1 c_2 ... c_k 1 - with none or any number of consecutive 0's and with binary core c_1 c_2 ... c_k, k >= 0 - share the same core value. Let p = C(q), then we can write, in decimal form, q = (2p+1) + 2^n, for an appropriate n. While the property is true for p prime, it can be generalized to any positive integer.
Conjecture: for any positive integer p, there are infinitely many primes q for which there exists an integer n such that q-(2p+1) = 2^n. (End)

Examples

			13 in base 2 is 1101 and 10 is 2;
23 in base 2 is 10111 and 011 is 3;
31 in base 2 is 11111 and 111 is 7.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,j,n,ok,x;  x:=5; for n from x to q do ok:=1; a:=convert(ithprime(n),base,2); b:=nops(a)-1; while a[b]=0 do b:=b-1; od; c:=0;
    for j from b by -1 to 2 do c:=2*c+a[j]; od;if isprime(c) then x:=n; print(ithprime(n)); fi; od; end: P(10^6);
    # simpler alternative:
    select(t -> isprime(t) and isprime((t - 2^ilog2(t) - 1)/2), [seq(i,i=3..10^4,2)]); # Robert Israel, Dec 28 2017
  • Mathematica
    Select[Prime[Range[200]],PrimeQ[FromDigits[Most[Rest[IntegerDigits[ #,2]]],2]]&] (* Harvey P. Dale, Jul 19 2020 *)
  • PARI
    lista(nn) = forprime(p=13, nn, if(isprime((p - 2^logint(p, 2) - 1)/2), print1(p, ", "))) \\ Iain Fox, Dec 28 2017
    
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p = 7
        while True:
            if isprime(int(bin(p)[3:-1], 2)):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 54))) # Michael S. Branicky, May 16 2022

Formula

Primes q such that C(q) = (q - 2^floor(log_2(q)) - 1)/2 is prime too.

A217350 Numbers k such that 4^k + 9 is prime.

Original entry on oeis.org

1, 3, 5, 9, 15, 33, 41, 335, 443, 671, 1197, 1355, 2247, 2639, 117293, 191099
Offset: 1

Views

Author

Vincenzo Librandi, Oct 01 2012

Keywords

Comments

The next terms are > 250000. - Robert Price, Oct 05 2015
Contains exactly the halved even terms of A057196.

Examples

			For k = 15, 4^15 + 9 = 1073741833 is prime.
		

Crossrefs

Cf. A057196, A089437 (similar sequence).

Programs

  • Magma
    [n: n in [0..700] | IsPrime(4^n+9)]; // Vincenzo Librandi, Oct 06 2015
    
  • Mathematica
    Select[Range[0, 5000], PrimeQ[4^# + 9] &]
  • PARI
    is(n)=ispseudoprime(4^n+9) \\ Charles R Greathouse IV, Jun 06 2017

Extensions

a(15)-a(16) derived from A057196 by Robert Price, Oct 05 2015

A217382 Numbers k such that 8^k + 9 is prime.

Original entry on oeis.org

1, 2, 3, 6, 10, 19, 22, 109, 798, 1498, 1519, 3109, 5491, 13351, 26983, 48799, 57909, 98109
Offset: 1

Views

Author

Vincenzo Librandi, Oct 03 2012

Keywords

Comments

All terms are equal to 1/3 of the multiples of 3 in A057196.

Crossrefs

Cf. A145440 (associated primes).

Programs

  • Mathematica
    Select[Range[10000], PrimeQ[8^# + 9] &]
  • PARI
    is(n)=ispseudoprime(8^n+9) \\ Charles R Greathouse IV, Jun 13 2017

Extensions

a(16)-a(18) from Michael S. Branicky, May 17 2025 using b-file at A057196

A172411 Numbers k such that 2^k+9 and 2^k+27 are prime.

Original entry on oeis.org

1, 2, 5, 10
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 02 2010

Keywords

Comments

No further terms between 10 and 5000. - R. J. Mathar, Feb 07 2010
No further terms to 100000. Expected number of remaining terms: (zeta(2) - 1 - 1/4 - ... - 1/100000^2)/log^2 2 ~= 0.00002. - Charles R Greathouse IV, Mar 25 2010

Examples

			a(1)=1 because 2^1+3^2=11 and 2^1+3^3=29 are prime.
		

Programs

  • Mathematica
    Select[Range[10],AllTrue[2^#+{9,27},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 28 2016 *)
  • PARI
    is(n)=isprime(2^n+9) && isprime(2^n+27) \\ Charles R Greathouse IV, Sep 06 2016

Formula

A057196 INTERSECT A157007 - R. J. Mathar, Feb 07 2010

A361744 A(n,k) is the least m such that there are k primes in the set {prime(n) + 2^i | 1 <= i <= m}, or -1 if no such number exists; square array A(n,k), n > 1, k >= 1, read by antidiagonals.

Original entry on oeis.org

1, 2, 1, 3, 3, 2, 4, 5, 4, 1, 6, 11, 6, 3, 2, 7, 47, 8, 5, 4, 1, 12, 53, 10, 7, 8, 13, 2, 15, 141, 16, 9, 20, 21, 6, 3, 16, 143, 18, 15, 38, 33, 30, 7, 1, 18, 191, 20, 23, 64, 81, 162, 39, 3, 4, 28, 273, 28, 29, 80, 129, 654, 79, 5, 12, 2
Offset: 2

Views

Author

Jean-Marc Rebert, Mar 22 2023

Keywords

Examples

			p = prime(2) = 3, m=1, u = {p + 2^k | 1 <= k <= m} = {5} contains one prime, and no lesser m satisfies this, so A(2,1) = 1.
Square array A(n,k) n > 1 and k >= 1 begins:
 1,     2,     3,     4,     6,     7,    12,    15,    16,    18, ...
 1,     3,     5,    11,    47,    53,   141,   143,   191,   273, ...
 2,     4,     6,     8,    10,    16,    18,    20,    28,    30, ...
 1,     3,     5,     7,     9,    15,    23,    29,    31,    55, ...
 2,     4,     8,    20,    38,    64,    80,   292,  1132,  4108, ...
 1,    13,    21,    33,    81,   129,   285,   297,   769,  3381, ...
 2,     6,    30,   162,   654,   714,  1370,  1662,  1722,  2810, ...
 3,     7,    39,    79,   359,   451,  1031,  1039, 11311, 30227, ...
 1,     3,     5,     7,     9,    13,    15,    17,    23,    27, ...
		

Crossrefs

Cf. A057732 (1st row), A094076 (1st column).
Cf. A361679.
Cf. A019434 (primes 2^n+1), A057732 (2^n+3), A059242 (2^n+5), A057195 (2^n+7), A057196(2^n+9), A102633 (2^n+11), A102634 (2^n+13), A057197 (2^n+15), A057200 (2^n+17), A057221 (2^n+19), A057201 (2^n+21), A057203 (2^n+23).
Cf. A205558 and A231232 (with 2*k instead of 2^k).

Programs

  • PARI
    A(n, k)= {my(nb=0, p=prime(n), m=1); while (nb
    				
Previous Showing 21-28 of 28 results.