OFFSET
1,5
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=8, C = {1,3,5,7}, c = 1+3+5+7 = 16, and a(n) = (16 mod 1) + (16 mod 3) + (16 mod 5) + (16 mod 7) = 0+1+1+2 = 4.
MAPLE
f:= proc(n) local C, s, c;
C:=select(t -> igcd(t, n) = 1, [$1..n-1]);
s:= convert(C, `+`);
add(s mod c, c = C)
end proc:
map(f, [$1..100]);
MATHEMATICA
Table[Total@ Mod[#2, #1] & @@ {#, Total@ #} &@ Select[Range[n], GCD[#, n] == 1 &], {n, 67}] (* Michael De Vlieger, Dec 31 2020 *)
PROG
(PARI) apply( {A340179(n, s=n*eulerphi(n)\/2)=sum(k=2, n-1, if(gcd(n, k)<2, s%k))}, [1..66]) \\ M. F. Hasler, Feb 01 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
J. M. Bergot and Robert Israel, Dec 30 2020
STATUS
approved