A080794 Numbers k whose digits are all contained, in any order, within the digits of prime(k).
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
Examples
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.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
okQ[n_] := Module[{idnp=IntegerDigits[Prime[n]], sidn=Sort[IntegerDigits[n]]}, Intersection[idnp, sidn]==sidn]; Select[Range[10000], okQ]
-
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
Extensions
Missing terms inserted by Michael S. Branicky, Sep 10 2022