OFFSET
1,2
FORMULA
a(n) >= A061799(n).
MATHEMATICA
f[n_] := Max[Tally[EulerPhi[Divisors[n]]][[;; , 2]]]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[12, 10^6]
PROG
(PARI) f(n) = vecmax(matreduce(apply(x->eulerphi(x), divisors(n)))[ , 2]);
lista(nmax, kmax = oo) = {my(v = vector(nmax), k = 1, c = 0, i); while(c < nmax && k < kmax, i = f(k); if(i <= nmax && v[i] == 0, c++; v[i] = k); k++); v}
(Python)
from collections import Counter
from itertools import count, islice
from sympy import divisors, totient
def agen(): # generator of terms
adict, n = dict(), 1
for k in count(1):
divs = divisors(k)
if len(divs) < n:
continue
c = Counter(totient(d) for d in divs)
v = c.most_common(1)[0][1]
if v not in adict:
adict[v] = k
while n in adict:
yield adict[n]
n += 1
print(list(islice(agen(), 11))) # Michael S. Branicky, Jun 08 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jun 08 2024
STATUS
approved