%I #17 Apr 07 2023 10:51:45
%S 1,3,10,52,398,4734,78428,1326821,26386288,645482585
%N First index in A362061 where A001221(A362061(a(n))) = n.
%o (Python)
%o from sympy import primefactors
%o from collections import Counter
%o from itertools import count, islice
%o def agen(): # generator of terms
%o an, c, d, d2, k = 1, Counter(), dict(), dict(), 0
%o for n in count(1):
%o if an in d: dpf = d[an]
%o else: dpf, d2[dpf] = len(primefactors(an)), n
%o c[dpf] += 1
%o an = c[dpf]
%o if k in d2: yield d2[k]; k += 1
%o print(list(islice(agen(), 7))) # _Michael S. Branicky_, Apr 06 2023
%o (Python)
%o from itertools import count
%o from sympy import primenu
%o def A362062(n):
%o a, b, c = {}, {}, 1
%o for m in count(1):
%o d = b[c] = b.get(c,primenu(c))
%o if d == n: return m
%o c = a[d] = a.get(d,0)+1 # _Chai Wah Wu_, Apr 07 2023
%Y Cf. A362061, A001221.
%K nonn,more
%O 0,2
%A _Scott R. Shannon_, Apr 06 2023
%E a(9) from _Chai Wah Wu_, Apr 07 2023
|