A340714 a(n) is the sum of (n-2*j) for j < n/2 coprime to n.
0, 0, 1, 2, 4, 4, 9, 8, 13, 12, 25, 12, 36, 24, 32, 32, 64, 28, 81, 40, 66, 60, 121, 48, 124, 84, 121, 84, 196, 56, 225, 128, 170, 144, 216, 108, 324, 180, 240, 160, 400, 120, 441, 220, 272, 264, 529, 192, 513, 252, 416, 312, 676, 244, 560, 336, 522, 420, 841, 240, 900, 480, 570, 512, 792, 320
Offset: 1
Examples
For n = 10, a(10) = (10-2*1) + (10-2*3) = 12.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local j; add(n-2*j, j= select(t -> igcd(t,n)=1, [$1..(n-1)/2])) end proc: map(f, [$1..100]);
-
Mathematica
Table[Sum[(n - 2 i) Floor[1/GCD[n - i, n]], {i, Floor[(n-1)/2]}], {n, 80}] (* Wesley Ivan Hurt, Jan 18 2021 *)
Formula
a(n) = Sum_{k=1..floor((n-1)/2)} floor(1/gcd(n,n-k)) * (n-2*k). - Wesley Ivan Hurt, Jan 18 2021
Comments