login
A386240
Primes containing the digit string "007" in their decimal representation.
2
4007, 6007, 9007, 10007, 10079, 12007, 13007, 16007, 20071, 24007, 30071, 36007, 45007, 50077, 60077, 61007, 64007, 70079, 78007, 80071, 80077, 82007, 88007, 90007, 90071, 90073, 94007, 97007, 100703, 100733, 100741, 100747, 100769, 100787, 100799, 103007, 108007
OFFSET
1,1
COMMENTS
Could also be called "James Bond" primes.
MAPLE
q:= n-> isprime(n) and searchtext("007", ""||n)>0:
select(q, [$1..110000])[]; # Alois P. Heinz, Jul 17 2025
MATHEMATICA
Select[Prime[Range[553, 12000]], StringContainsQ[IntegerString[#], "007"] &] (* Paolo Xausa, Jul 17 2025 *)
PROG
(Python)
from sympy import sieve
print([sieve[n] for n in range(1, 10200) if "007" in str(sieve[n])]) # Karl-Heinz Hofmann, Jul 17 2025
(PARI) is(n) = if(!isprime(n), return(0)); while(n > 10, if(n%1000==7, return(1)); n\=10); 0 \\ David A. Corneth, Jul 17 2025
CROSSREFS
KEYWORD
nonn,base,dumb,less
AUTHOR
Hugo Pfoertner, Jul 16 2025
STATUS
approved