login
A365678
Primes p whose index has a submultiset of their decimal digits.
1
17, 367, 491, 1327, 1823, 2039, 2131, 2143, 2153, 2693, 4621, 5417, 5701, 6481, 6883, 7459, 7691, 10723, 11483, 11593, 12491, 12497, 12853, 14723, 15287, 17093, 24781, 25849, 26951, 27091, 27179, 33569, 33967, 34367, 35171, 35809, 39451, 40283, 41263, 41543, 41983, 42437, 45971
OFFSET
1,1
COMMENTS
Number of terms < 10^k, k > 0: 0, 1, 3, 17, 132, 379, 1422, 7156, 39004, 237792, ...
LINKS
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
Sequence in context: A120287 A222678 A293691 * A002197 A070148 A097499
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Sep 15 2023
STATUS
approved