login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A367186
Numbers that can be written as 2^k + prime in more than one way.
1
4, 6, 7, 9, 11, 13, 15, 18, 19, 21, 23, 25, 27, 31, 33, 35, 37, 39, 43, 45, 47, 49, 51, 55, 57, 61, 63, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 91, 93, 95, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 121, 123, 125, 129, 131, 133, 135, 139, 141, 143, 145, 147, 151, 153, 155
OFFSET
1,1
COMMENTS
Numbers m such that A109925(m) > 1.
EXAMPLE
4 is a term since 4 = 2^0 + 3 = 2^1 + 2 which is 2 ways.
6 is a term since 6 = 2^0 + 5 = 2^2 + 2.
PROG
(PARI) isok(m) = sum(k=0, logint(m, 2), isprime(m-2^k)) > 1; \\ Michel Marcus, Nov 10 2023
(Python)
from itertools import count, islice
from sympy import isprime
def A367186_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
c = 0
for i in range(n.bit_length()-1, -1, -1):
if isprime(n-(1<<i)):
c+=1
if c>1:
yield n
break
A367186_list = list(islice(A367186_gen(), 30)) # Chai Wah Wu, Nov 29 2023
CROSSREFS
Subsequence of A118955.
Sequence in context: A186497 A193627 A256792 * A345665 A343177 A085817
KEYWORD
nonn
AUTHOR
Yuda Chen, Nov 08 2023
STATUS
approved