OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6) = 11 because sigma(6) = sigma(11) = 12.
MATHEMATICA
a[n_] := Block[{s = DivisorSigma[1, n], k}, k=s; While[ DivisorSigma[1, k] != s, k--]; k]; Array[a, 66] (* Giovanni Resta, May 20 2019 *)
PROG
(Magma) [Max([k: k in[1..10000] | SumOfDivisors(k) eq SumOfDivisors(n)]): n in [1..100]]
(PARI) a(n) = {my(s=sigma(n)); forstep(i=s, 1, -1, if (sigma(i) == s, return(i)); ); } \\ Michel Marcus, May 12 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, May 12 2019
STATUS
approved