OFFSET
1,1
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, ...
...
EXAMPLE
13 is in this sequence because 2^(13+1) - 3 = 16381 (prime) and 2^(13+1) + 3 = 16387 (composite number).
MATHEMATICA
Select[Range[400], PrimeQ[#] && Xor @@ PrimeQ[2^(# + 1) + {-3, 3}] &] (* Amiram Eldar, Jan 19 2020 *)
PROG
(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)])];
(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
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Juri-Stepan Gerasimov, Jan 18 2020
EXTENSIONS
STATUS
approved