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.

A285929 Numbers m such that 2^m + (-1)^m is prime.

Original entry on oeis.org

0, 2, 3, 4, 5, 7, 8, 13, 16, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 28 2017

Keywords

Comments

With 1, exponents of A141453 (see comment by Wolfdieter Lang, Mar 28 2012).
Numbers m such that (1 + k)^m + (-k)^m is prime:
0 (k = 0);
this sequence (k = 1);
A283653 (k = 2);
0, 3, 4, 7, 16, 17, ... (k = 3);
0, 2, 3, 4, 43, 59, 191, 223, ... (k = 4);
0, 2, 5, 8, 11, 13, 16, 23, 61, 83, ... (k = 5);
0, 3, 4, 7, 16, 29, 41, 67, ... (k = 6);
0, 2, 7, 11, 16, 17, 29, 31, 79, 43, 131, 139, ... (k = 7);
0, 4, 7, 29, 31, 32, 67, ... (k = 8);
0, 2, 3, 4, 7, 11, 19, 29, ... (k = 9);
0, 3, 5, 19, 32, ... (k = 10);
0, 3, 7, 89, 101, ... (k = 11);
0, 2, 4, 17, 31, 32, 41, 47, 109, 163, ... (k = 12);
0, 3, 4, 11, 83, ... (k = 13);
0, 2, 3, 4, 16, 43, 173, 193, ... (k = 14);
0, 43, ... (k = 15);
0, 4, 5, 7, 79, ... (k = 16);
0, 2, 3, 8, 13, 71, ... (k = 17);
0, 1607, ... (k = 18);
...
Numbers m such that (1 + k)^m + (-k)^m is not an odd prime for k <= m: 0, 1, 15, 18, 53, 59, 106, 114, 124, 132, 133, 143, 177, 214, 232, 234, 240, 256, ...
Conjecture: if (1 + y)^x + (-y)^x is a prime number then x is zero, or an even power of two, or an odd prime number.
The above conjecture can be proved by considering algebraic factorizations of the polynomials involved. - Jeppe Stig Nielsen, Feb 19 2023
Appears to be essentially the same as A174269. - R. J. Mathar, May 21 2017

Examples

			4 is in this sequence because 2^4 + (-1)^4 = 17 is prime.
5 is in this sequence because 2^5 + (-1)^5 = 31 is prime.
		

Crossrefs

Programs

  • Magma
    [m: m in [0..1000]| IsPrime(2^m + (-1)^m)];
    
  • Mathematica
    Select[Range[0, 10^4], PrimeQ[2^# + (-1)^#] &] (* Michael De Vlieger, May 03 2017 *)
  • PARI
    is(m)=ispseudoprime(2^m+(-1)^m) \\ Charles R Greathouse IV, Jun 06 2017

Formula

a(n) = A174269(n) for n > 2. - Jeppe Stig Nielsen, Feb 19 2023

A264747 Prime powers n such that either n - 1 or n + 1 is a prime power, but not both.

Original entry on oeis.org

1, 5, 7, 9, 16, 17, 31, 32, 127, 128, 256, 257, 8191, 8192, 65536, 65537, 131071, 131072, 524287, 524288, 2147483647, 2147483648, 2305843009213693951, 2305843009213693952, 618970019642690137449562111
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 23 2015

Keywords

Comments

From Robert Israel, Nov 25 2015: (Start)
By Mihailescu's theorem, the only case where n-1 and n are both in A025475 is n=9. Thus for n > 9 the sequence consists of the following:
n = 2^p - 1 and 2^p where 2^p-1 is a Mersenne prime (A000668);
n = 2^(2^m) and 2^(2^m)+1 where 2^(2^m)+1 is a Fermat prime (A019434).
(End)

Examples

			7 is in this sequence because 7 and 7 + 1 = 8 are both prime power, but 7 - 1 = 6 is not a prime power.
		

Crossrefs

Programs

  • Maple
    fermats:= {seq(2^(2^m)+1, m=1..4)}:
    mersennes:= {seq(numtheory:-mersenne([i]), i=2..14)}:
    R:= fermats union map(`-`,fermats,1) union mersennes union map(`+`,mersennes,1):
    sort(convert(R union {1,9} minus {2,3,4,8},list)); # Robert Israel, Nov 25 2015
  • PARI
    is(k) = isprimepower(k) || k==1;
    for(k=1, 1e6, if(is(k) && is(k-1) + is(k+1) == 1, print1(k, ", "))) \\ Altug Alkan, Nov 23 2015

A331487 Primes p such that exactly one of 2^(p+1) - 3 and 2^(p+1) + 3 is a prime.

Original entry on oeis.org

13, 17, 19, 23, 29, 83, 149, 173, 227, 389, 1109, 4001, 35753, 36551, 363119, 702193
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 18 2020

Keywords

Comments

Primes p such that exactly one of k*2^p - 2*k + 1 and k*2^p + 2*k - 1 is a prime:
k = 1: odd terms in A000043;
k = 2: this sequence;
k = 3: 5, 13, 19, 29, 31, 109, 139, 271, 379, 1553, ...
k = 4: 2, 37, ...
k = 5: 3, 5, 7, 17, 19, 23, 41, 61, 67, 151, 157, 313, 4111, 6337, ...
k = 6: 2, 5, 7, 11, 19, 29, 149, 191, 373, 449, 983, 1667, 1973, ...
k = 7: 2, 3, 5, 7, 11, 13, 29, 43, 61, 97, 109, 127, 131, 239, 461, 1153, ...
k = 8: 3, 11, 19, 23, 29, 37, 43, 97, 193, 307, 617, 1847, ...
k = 9: 3, 5, 23, 41, 61, 71, 97, 131, 157, 863, 3119, ...
k = 10: 2, 3, 13, ...
...

Examples

			13 is in this sequence because 2^(13+1) - 3 = 16381 (prime) and 2^(13+1) + 3 = 16387 (composite number).
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(1000) | not (#[k: k in [2] | IsPrime(k*2^p-2*k+1)]) eq (#[k: k in [2] | IsPrime(k*2^p+2*k-1)])];
    
  • Mathematica
    Select[Range[400], PrimeQ[#] && Xor @@ PrimeQ[2^(# + 1) + {-3, 3}] &] (* Amiram Eldar, Jan 19 2020 *)
  • PARI
    isok(p) = isprime(2*2^p-3) + isprime(2*2^p+3) == 1;
    forprime(p=2, 500, if(isok(p), print1(p, ", "))); \\ Jinyuan Wang, Jan 19 2020

Extensions

a(12)-a(16) added using A050414 and A057732 by Jinyuan Wang, May 15 2020
Showing 1-3 of 3 results.