OFFSET
1,5
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=8, sigma(8) = 15 and C(8) = {1,3,5,7} so a(8) = (15 mod 1) + (15 mod 3) + (15 mod 5) + (15 mod 7) = 1.
MAPLE
f := proc(n) local C, s, c;
s:= numtheory:-sigma(n);
C:=select(t -> igcd(t, n) = 1, [$1..n-1]);
add(s mod c, c=C)
end proc:
map(f, [$1..100]);
MATHEMATICA
Table[Sum[Mod[DivisorSigma[1, n], k] Floor[1/GCD[k, n]], {k, n - 1}], {n, 80}] (* Wesley Ivan Hurt, Jan 30 2021 *)
PROG
(PARI) a(n) = my(s=sigma(n)); sum(k=1, n, if (gcd(k, n)==1, s % k)); \\ Michel Marcus, Jan 31 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
J. M. Bergot and Robert Israel, Dec 30 2020
STATUS
approved