OFFSET
1,2
COMMENTS
Conjecture: all terms of this sequence are greater than 0.
Conjecture tested holds up to n = 10000.
Terms for all n tend to be small integers.
All Mersenne primes and primes of the forms 3*2^n+-1, 5*2^n+-1, 7*2^n+-1, and 15*2^n+-1 form a subgroup of this type of primes.
A large prime that is explicitly found for this type is 2^1048576 - 2^891232 - 1.
I conjecture the contrary: infinitely many elements of this sequence are equal to 0. Probably the first n with a(n) = 0 is less than a million. - Charles R Greathouse IV, Nov 21 2011
LINKS
Lei Zhou, Table of n, a(n) for n = 1..10000
Chris Caldwell, ed., 2^1048576-2^891232-1
EXAMPLE
For n=1,
2^1 + 2^0 - 1 = 2^1 - 2^0 + 1 = 2: 1 prime, so a(1)=1.
For n=2,
2^2 - 2^0 - 1 = 2;
2^2 - 2^1 + 1 = 3;
2^2 + 2^1 - 1 = 2^2 - 2^1 + 1 = 5;
2^2 + 2^1 + 1 = 7: 4 primes found, so a(2)=4.
...
For n=11,
2^11 - 2^5 + 1 = 2017;
2^11 - 2^3 - 1 = 2039;
2^11 + 2^2 + 1 = 2053;
2^11 + 2^4 - 1 = 2063;
2^11 + 2^5 + 1 = 2081;
2^11 + 2^6 - 1 = 2111;
2^11 + 2^6 + 1 = 2113: 7 primes found, so a(11)=7.
MATHEMATICA
Table[c1 = 2^i; cs = {};
Do[c2 = 2^j; cp = c1 + c2 + 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
cp = c1 + c2 - 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
cp = c1 - c2 + 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
cp = c1 - c2 - 1;
If[PrimeQ[cp], cs = Union[cs, {cp}]], {j, 0, i - 1}];
Length[cs], {i, 1, 100}]
PROG
(PARI) a(n)=my(v=List(), t); for(k=0, n-1, if(isprime(t=2^n-2^k-1), listput(v, t)); if(isprime(t=2^n-2^k+1), listput(v, t)); if(isprime(t=2^n+2^k-1), listput(v, t); if(isprime(t=2^n+2^k+1), listput(v, t)))); #Set(v) \\ Charles R Greathouse IV, Oct 06 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Oct 05 2011
EXTENSIONS
Edited by Jon E. Schoenfield, Mar 15 2021
STATUS
approved