A214705 Primes that contain only the digits (2, 5, 7).
2, 5, 7, 227, 257, 277, 557, 577, 727, 757, 2557, 2777, 5227, 5527, 5557, 7577, 7727, 7757, 22277, 22727, 22777, 25577, 27277, 27527, 52727, 52757, 57527, 57557, 57727, 72227, 72277, 72577, 72727, 75227, 75277, 75527, 75557, 75577, 77527, 77557, 222527, 222557
Offset: 1
Links
- Jason Bard, Table of n, a(n) for n = 1..10000 (first 1000 terms from Vincenzo Librandi)
Programs
-
Magma
[p: p in PrimesUpTo(100000) | Set(Intseq(p)) subset [2,5,7]];
-
Mathematica
Flatten[Table[Select[FromDigits/@Tuples[{2,5,7},n],PrimeQ],{n,6}]]
-
Python
from sympy import primerange def ok(p): return set(str(p)) <= set("257") def aupto(limit): return [p for p in primerange(2, limit+1) if ok(p)] print(aupto(222557)) # Michael S. Branicky, Feb 05 2021
Comments