A340179 a(n) = Sum_{x in C(n)} (A023896(n) mod x), where C(n) is the set of numbers < n coprime to n, and A023896(n) is the sum of C(n).
0, 0, 1, 1, 3, 1, 6, 4, 15, 10, 25, 9, 33, 20, 25, 32, 49, 24, 56, 34, 68, 48, 98, 35, 152, 54, 100, 89, 180, 30, 178, 91, 146, 146, 150, 115, 314, 160, 220, 166, 315, 120, 306, 211, 267, 254, 412, 196, 485, 224, 383, 339, 600, 243, 609, 306, 481, 419, 801, 215, 859, 490, 577, 567, 782, 297, 865
Offset: 1
Examples
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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