OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..60
MATHEMATICA
s[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; Times @@ ((p^(e + 1) - 1)/(p - 1)) - Times @@ (p + 1)]; s[1] = 0; seq[max_] := Module[{v = Select[Array[s, max], 0 < # <= max &], sq = {0}, t, tmax = 0}, t = Sort[Tally[v]]; Do[If[t[[k]][[2]] > tmax, tmax = t[[k]][[2]]; AppendTo[sq, t[[k]][[2]]]], {k, 1, Length[t]}]; sq]; seq[10^5]
PROG
(PARI) s(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; ((p^(e + 1) - 1)/(p - 1))) - prod(i = 1, #f~, f[i, 1] + 1); }
lista(kmax) = {my(v = vector(kmax), vmax = 0, i); for(k=1, kmax, i = s(k); if(i > 0 && i <= kmax, v[i]++)); print1(0, ", "); for(k=1, kmax, if(v[k] > vmax, vmax = v[k]; print1(v[k], ", "))); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Apr 18 2023
STATUS
approved