login
A355317
Prime numbers that have the same base-10 digits as their prime index (with multiplicity), disregarding zero digits.
3
5701, 27091, 50417, 55049, 57089, 60601, 61051, 63607, 66301, 72019, 132607, 270913, 284057, 574031, 654301, 936007, 936907, 950647, 1250609, 1461001, 1504417, 1580921, 1682069, 1703287, 1750631, 1810553, 1810573, 1837601, 2050241, 2145089, 2485001, 2641109, 2709169, 2800333, 2805703
OFFSET
1,1
EXAMPLE
15097067 is a term since its index primepi(15097067) = 976571 shares the same multiset of nonzero digits {1,5,6,7,7,9}.
MATHEMATICA
a[max_] := Module[{l}, Select[{#, Prime[#]} & /@ Range[max], (l = IntegerDigits[#[[2]]]; SortBy[Tally[l], First] === SortBy[Tally[PadLeft[IntegerDigits[#[[1]]], Length[l]]], First]) &]]; a[10^6][[All, 2]] (* Gives the first 108 terms *)
PROG
(Python)
from sympy import nextprime
from itertools import islice
def b10s(n): return "".join(sorted(str(n))).lstrip("0")
def agen():
k, pk = 1, 2
while True:
if b10s(k) == b10s(pk): yield pk
k, pk = k+1, nextprime(pk)
print(list(islice(agen(), 32))) # Michael S. Branicky, Jun 28 2022
(PARI) digs(k) = vecsort(select(x->(x>0), digits(k)));
isok(p) = if (isprime(p), digs(p) == digs(primepi(p))); \\ Michel Marcus, Jul 05 2022
CROSSREFS
Cf. A355318 (the prime indices), A355539.
Cf. A355418.
Sequence in context: A269344 A184147 A235207 * A252342 A237743 A025027
KEYWORD
base,easy,nonn
AUTHOR
Xiaofeng Wang, Jun 28 2022
STATUS
approved