OFFSET
1,3
COMMENTS
Apart from the first term, all terms are primes (Mersenne exponents) or powers of two (Fermat exponents). The sequence consists of all members of A000043 and A092506, apart from 2. - Charles R Greathouse IV, Mar 20 2010
Numbers k such that one of 2^k+1 or 2^k-1 is prime, but not both. - R. J. Mathar, Mar 29 2010
The sequence "Numbers k such that 2^k + (-1)^k is a prime" gives essentially the same sequence, except with the initial 1 replaced by 2. - Thomas Ordowski, Dec 26 2016
The union of 2 and this sequence gives the values k for which 2^k or 2^k - 1 are the numbers in A006549. - Gionata Neri, Dec 19 2015
The union of 2 and this sequence is the values k for which either 2^k - 1 or 2^k + 1, or both, are prime. The reason why this only yields one additional term, 2, is because the number 3 always divides either 2^k - 1 or 2^k + 1 (also implicit in Ordowski comment). - Jeppe Stig Nielsen, Feb 19 2023
LINKS
Jeppe Stig Nielsen, Table of n, a(n) for n = 1..52
FORMULA
a(n) = A285929(n) for n > 2. - Jeppe Stig Nielsen, Feb 19 2023
EXAMPLE
0 is in the sequence because 2^0 - 1 = 0 is nonprime and 2^0 + 1 = 2 is prime; 2 is not in the sequence because 2^2 - 1 = 3 and 2^2 + 1 = 5 are both prime.
MATHEMATICA
Select[Range[0, 5000], Xor[PrimeQ[2^# - 1], PrimeQ[2^# + 1]] &] (* Michael De Vlieger, Jan 03 2016 *)
PROG
(PARI) isok(k) = my(p = 2^k-1, q = p+2); bitxor(isprime(p), isprime(q)); \\ Michel Marcus, Jan 03 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Mar 14 2010
EXTENSIONS
a(10)-a(43) from Charles R Greathouse IV, Mar 20 2010
STATUS
approved