login
A056709
Naught-y primes, primes with noughts (or zeros).
20
101, 103, 107, 109, 307, 401, 409, 503, 509, 601, 607, 701, 709, 809, 907, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1201, 1301, 1303, 1307, 1409, 1601, 1607, 1609, 1709, 1801, 1901, 1907
OFFSET
1,1
COMMENTS
Intersection of A000040 and A011540. - Michel Marcus, Mar 12 2015
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Chris Caldwell, Naughty prime, Prime Pages' Glossary (UTM). (Date?)
FORMULA
a(n) ~ n log n: almost all primes are in this sequence. - Charles R Greathouse IV, Jul 24 2012
MATHEMATICA
Select[ Range[ 1, 2500, 2 ], PrimeQ[ # ] && Sort[ RealDigits[ # ][ [ 1 ] ] ][ [ 1 ] ] == 0 & ]
(* Second program: *)
Select[Prime@ Range@ 300, DigitCount[#, 10, 0] > 0 &] (* Michael De Vlieger, Jan 28 2020 *)
PROG
(PARI) is(n)=isprime(n)&&vecsort(eval(Vec(Str(n))), , 8)[1]==0
(PARI)
select( {is_A056709(n)=!vecmin(digits(n))&&isprime(n)}, [1..2000]) \\ Defines the characteristic function is_A; as check & example: select terms in [1..2000].
next_A056709(n)={until(!vecmin(digits(n)), n=nextprime(n+1)); n} \\ Successor function: find smallest a(k) > n. Useful to get a vector of consecutive terms:
A056709_vec(n, M=99)=M--; vector(n, i, M=next_A056709(M)) \\ get n terms >= M (if given, else start with a(1)). \\ M. F. Hasler, Jan 12 2020
(Magma) [p:p in PrimesUpTo(2000)|0 in Intseq(p)]; // Marius A. Burtea, Jan 13 2020
(Python)
from sympy import primerange
def aupto(lim): return [p for p in primerange(1, lim+1) if '0' in str(p)]
print(aupto(1910)) # Michael S. Branicky, Mar 11 2022
CROSSREFS
Cf. A000040 (primes), A011540 (numbers that contain a 0).
Complement, in A000040, of zeroless primes A038618.
Cf. A164968 (Naughty primes: most digits are 0).
Sequence in context: A164739 A085821 A183087 * A243825 A345728 A309488
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Aug 10 2000
STATUS
approved