A342244 Primes whose binary representation is not the concatenation of the binary representations of smaller primes (allowing leading 0's).
2, 3, 5, 7, 13, 17, 41, 73, 89, 97, 137, 193, 257, 281, 313, 409, 449, 521, 569, 577, 617, 641, 673, 761, 769, 929, 953, 1033, 1049, 1153, 1249, 1289, 1409, 1601, 1657, 1697, 1721, 1801, 1913, 2081, 2113, 2153, 2297, 2441, 2593, 2713, 3137, 3257, 3361, 3449
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A090422.
Programs
-
Maple
CSP:= proc(n) option remember; local g; g:= proc(k) local v; v:= n mod 2^k; isprime(floor(n/2^k)) and (isprime(v) or CSP(v)) end proc; ormap(g, [$2..ilog2(n)]) end proc: CSP(0):= false: remove(CSP, [seq(ithprime(i),i=1..1000)]); # Robert Israel, May 22 2024
-
Python
from sympy import isprime, primerange def ok(p): b = bin(p)[2:] for i in range(2, len(b)-1): if isprime(int(b[:i], 2)): if isprime(int(b[i:], 2)) or not ok(int(b[i:], 2)): return False return True def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)] print(aupto(3449)) # Michael S. Branicky, Mar 07 2021
Comments