OFFSET
1,2
EXAMPLE
MATHEMATICA
a[max_] := Block[{p, b, x, y}, p = Module[{l}, Select[{#, Prime[#]} & /@ Range[max], (l = IntegerDigits[#[[2]]]; SortBy[Tally[l], First] === SortBy[Tally[PadLeft[IntegerDigits[#[[1]]], Length[l]]], First]) &]]; Do[{x, y} = {Count[IntegerDigits[p[[i, 1]]], 0], Count[IntegerDigits[p[[i, 2]]], 0]}; If[! IntegerQ[b[x, y]], b[x, y] = i], {i, Length[p]}]; Sort[DownValues[b][[All, 2]]]]; a[100010000] (* Gives the first 9 terms *)
PROG
(Python)
from itertools import count, islice
from sympy import nextprime
def A355539_gen(): # generator of terms
p, s, k = 2, set(), 0
for i in count(1):
if int(a:=''.join(sorted(str(p))))==int(b:=''.join(sorted(str(i)))):
k += 1
if (q:=(a.count('0'), b.count('0'))) not in s:
yield k
s.add(q)
p = nextprime(p)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Xiaofeng Wang, Jul 06 2022
STATUS
approved