login
A080794
Numbers k whose digits are all contained, in any order, within the digits of prime(k).
4
7, 73, 94, 217, 281, 309, 321, 324, 325, 392, 624, 715, 751, 841, 886, 945, 976, 1307, 1384, 1395, 1491, 1492, 1532, 1723, 1785, 1970, 2741, 2845, 2956, 2971, 2977, 3593, 3637, 3673, 3751, 3805, 4153, 4230, 4321, 4345, 4391, 4437, 4759, 4978, 4980, 5174, 5317
OFFSET
1,1
LINKS
EXAMPLE
6347 is a term because prime(6347) = 63347.
886 is a term because prime(886) = 6883.
11 is not a term because prime(11) = 31, which does not contain two 1's.
MATHEMATICA
okQ[n_] := Module[{idnp=IntegerDigits[Prime[n]], sidn=Sort[IntegerDigits[n]]}, Intersection[idnp, sidn]==sidn]; Select[Range[10000], okQ]
PROG
(Python)
from sympy import nextprime
from collections import Counter
from itertools import count, islice
def agen2(): # generator of terms
pk = 2
for k in count(1):
cpk, ck = Counter(str(pk)), Counter(str(k))
if all(cpk[d] >= ck[d] for d in ck): yield (k, pk)
pk = nextprime(pk)
print(list(islice(agen2(), 47))) # Michael S. Branicky, Sep 10 2022
CROSSREFS
Sequence in context: A137730 A157920 A321077 * A082719 A188465 A142053
KEYWORD
base,easy,nonn
AUTHOR
Harvey P. Dale, Mar 13 2003
EXTENSIONS
Missing terms inserted by Michael S. Branicky, Sep 10 2022
STATUS
approved