A367186 Numbers that can be written as 2^k + prime in more than one way.
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
Keywords
Examples
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.
Programs
-
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<1: yield n break A367186_list = list(islice(A367186_gen(),30)) # Chai Wah Wu, Nov 29 2023
Comments