A261182 Primes having only {2, 7, 9} as digits.
2, 7, 29, 79, 97, 227, 229, 277, 727, 797, 929, 977, 997, 2297, 2729, 2777, 2797, 2927, 2999, 7229, 7297, 7727, 7927, 9227, 9277, 9929, 22229, 22277, 22279, 22727, 22777, 27277, 27299, 27779, 27799, 27997, 29297, 29927, 72227, 72229, 72277, 72727, 72797
Offset: 1
Links
- Jason Bard, Table of n, a(n) for n = 1..10000 (first 1000 terms from Chai Wah Wu)
- Index to entries for primes with digits in a given set
Programs
-
Magma
[p: p in PrimesUpTo(2*10^5) | Set(Intseq(p)) subset [2, 7, 9]];
-
Mathematica
Select[Prime[Range[2 10^4]], Complement[IntegerDigits[#], {2, 7, 9}] == {} &] Select[Flatten[Table[FromDigits/@Tuples[{2,7,9},n],{n,5}]],PrimeQ] (* Harvey P. Dale, Dec 17 2024 *)
-
Python
from gmpy2 import is_prime from itertools import product A261182_list = [int(''.join(d)) for l in range(1,10) for d in product('279',repeat=l) if is_prime(int(''.join(d)))] # Chai Wah Wu, Aug 11 2015
Comments