A342475 Prime numbers whose binary expansion contains only prime powers of 2 and the zeroth power.
5, 13, 37, 41, 137, 173, 2053, 2081, 2089, 2213, 2221, 8233, 8237, 8329, 8353, 10253, 10273, 10369, 131113, 131213, 133121, 133153, 133157, 133253, 133261, 139273, 139297, 139301, 139309, 139393, 139397, 139429, 141353, 141481, 524429, 524453, 526373, 526381, 526501
Offset: 1
Examples
5 = 2^2 + 2^0 is a term. 7 = 2^2 + 2^1 + 2^0 is not a term, because the exponent 1 is not a prime. 11 = 2^3 + 2^1 + 2^0 is not a term, because the exponent 1 is not a prime. 13 = 2^3 + 2^2 + 2^0 is a term.
Programs
-
Mathematica
Select[Array[1 + Total@ MapIndexed[#1*2^Prime[#2] & @@ {#1, First[#2]} &, Reverse@ IntegerDigits[#, 2]] &, 140], PrimeQ] (* Michael De Vlieger, Mar 13 2021 *)
-
PARI
isok(p) = if (isprime(p), my(b=Vecrev(binary(p))); sum(i=1, #b, b[i]*((i!=1) && !isprime(i-1))) == 0); \\ Michel Marcus, Apr 22 2021
Comments