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
KEYWORD
base,easy,nonn
AUTHOR
Xiaofeng Wang, Jun 28 2022
STATUS
approved