OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
Carlos Rivera, Puzzle 1065. A larger integer than 45 such that ..., The Prime Puzzles and Problems Connection.
FORMULA
EXAMPLE
For n = 4; a(4) = (7 mod 1) + (7 mod 2) + (7 mod 4) = 0 + 1 + 3 = 4.
MATHEMATICA
a[n_] := Block[{s = DivisorSigma[1, n]}, DivisorSum[n, Mod[s, #] &]]; Array[a, 72] (* Giovanni Resta, Sep 07 2018 *)
PROG
(Magma) [&+[SumOfDivisors(n) mod d: d in Divisors(n)] : n in [1..1000]]
(PARI) a(n) = my(sn = sigma(n)); sumdiv(n, d, sn % d); \\ Michel Marcus, Sep 07 2018
(Python)
from sympy import divisors
def a(n): divs = divisors(n); s = sum(divs); return sum(s%d for d in divs)
print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Nov 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Sep 07 2018
STATUS
approved