OFFSET
1,1
COMMENTS
Number of terms < 10^k, k > 0: 0, 1, 3, 17, 132, 379, 1422, 7156, 39004, 237792, ...
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) is 17 since 17 is the 7th prime;
a(2) is not 31 since it is the 11th prime;
a(2) is 367 since it is the 73rd prime;
a(3) is 491 since it is the 94th prime;
a(237793) = 10000865549 since it is the 455090018th prime; etc.
MATHEMATICA
idx = 1; p = 2; lst = {}; While[p < 50001, If[ MemberQ[ Subsets[ Sort@ IntegerDigits@ p, IntegerLength@ idx], Sort@ IntegerDigits@ idx], AppendTo[lst, p]; Print[{p, idx}]]; idx++; p = NextPrime@p]; lst
PROG
(Python)
from sympy import nextprime
from itertools import islice
from collections import Counter
def agen(): # generator of terms
i, p = 1, 2
while True:
if Counter(str(i)) <= Counter(str(p)): yield p
i, p = i+1, nextprime(p)
print(list(islice(agen(), 43))) # Michael S. Branicky, Sep 15 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Sep 15 2023
STATUS
approved