login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056709 Naught-y primes, primes with noughts (or zeros). 20

%I #26 Sep 08 2022 08:45:01

%S 101,103,107,109,307,401,409,503,509,601,607,701,709,809,907,1009,

%T 1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,

%U 1093,1097,1103,1109,1201,1301,1303,1307,1409,1601,1607,1609,1709,1801,1901,1907

%N Naught-y primes, primes with noughts (or zeros).

%C Intersection of A000040 and A011540. - _Michel Marcus_, Mar 12 2015

%H Charles R Greathouse IV, <a href="/A056709/b056709.txt">Table of n, a(n) for n = 1..10000</a>

%H Chris Caldwell, <a href="https://primes.utm.edu/glossary/page.php?sort=NaughtyPrime">Naughty prime</a>, Prime Pages' Glossary (UTM). (Date?)

%F a(n) ~ n log n: almost all primes are in this sequence. - _Charles R Greathouse IV_, Jul 24 2012

%t Select[ Range[ 1, 2500, 2 ], PrimeQ[ # ] && Sort[ RealDigits[ # ][ [ 1 ] ] ][ [ 1 ] ] == 0 & ]

%t (* Second program: *)

%t Select[Prime@ Range@ 300, DigitCount[#, 10, 0] > 0 &] (* _Michael De Vlieger_, Jan 28 2020 *)

%o (PARI) is(n)=isprime(n)&&vecsort(eval(Vec(Str(n))),,8)[1]==0

%o (PARI)

%o 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].

%o 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:

%o 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

%o (Magma) [p:p in PrimesUpTo(2000)|0 in Intseq(p)]; // _Marius A. Burtea_, Jan 13 2020

%o (Python)

%o from sympy import primerange

%o def aupto(lim): return [p for p in primerange(1, lim+1) if '0' in str(p)]

%o print(aupto(1910)) # _Michael S. Branicky_, Mar 11 2022

%Y Cf. A000040 (primes), A011540 (numbers that contain a 0).

%Y Complement, in A000040, of zeroless primes A038618.

%Y Cf. A164968 (Naughty primes: most digits are 0).

%K nonn,base

%O 1,1

%A _Robert G. Wilson v_, Aug 10 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 1 19:22 EDT 2024. Contains 374817 sequences. (Running on oeis4.)