OFFSET
1,2
COMMENTS
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 = {1}, t, tmax = 0}, t = Sort[Tally[v]]; Do[If[t[[k]][[2]] > tmax, tmax = t[[k]][[2]]; AppendTo[sq, t[[k]][[1]]]], {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(1, ", "); for(k=1, kmax, if(v[k] > vmax, vmax = v[k]; print1(k, ", "))); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Apr 18 2023
STATUS
approved