login
Primes without {0, 2} as digits.
3

%I #7 Jul 18 2025 23:51:16

%S 3,5,7,11,13,17,19,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,113,

%T 131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,311,313,

%U 317,331,337,347,349,353,359,367,373,379,383,389,397,419,431,433,439

%N Primes without {0, 2} as digits.

%H Jason Bard, <a href="/A386320/b386320.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Pri#PrimesWithDigits">Index to entries for primes with digits in a given set</a>

%t Select[Prime[Range[120]], DigitCount[#, 10, 0] == 0 && DigitCount[#, 10, 2] == 0 &]

%o (Magma) [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [1, 3, 4, 5, 6, 7, 8, 9]];

%o (Python) print(list(islice(primes_with("13456789"), 41))) # uses function/imports in A385776

%o (PARI) primes_with(, 1, [1, 3, 4, 5, 6, 7, 8, 9]) \\ uses function in A385776

%Y Intersection of A038604 and A038618.

%Y Cf. A000040, A385776.

%K nonn,base,easy

%O 1,1

%A _Jason Bard_, Jul 18 2025