A344373 a(n) = Sum_{k=1..n-1} (-1)^k gcd(k, n).
0, -1, 0, 0, 0, -1, 0, 4, 0, -1, 0, 8, 0, -1, 0, 16, 0, 3, 0, 16, 0, -1, 0, 36, 0, -1, 0, 24, 0, 15, 0, 48, 0, -1, 0, 48, 0, -1, 0, 68, 0, 23, 0, 40, 0, -1, 0, 112, 0, 15, 0, 48, 0, 27, 0, 100, 0, -1, 0, 120, 0, -1, 0, 128, 0, 39, 0, 64, 0, 47, 0, 180, 0, -1, 0, 72, 0, 47, 0, 208, 0, -1, 0, 176, 0, -1, 0, 164, 0, 99
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
- Pruthviraj et al., Is it always true that Sum_{i=1..a-1}(-1)^i(a,i) >= -1 ?, 2021.
Programs
-
Mathematica
Array[Sum[(-1)^k GCD[k, #], {k, # - 1}] &, 90] (* Michael De Vlieger, May 16 2021 *)
-
PARI
A344373(n) = sum(k=1,n-1,((-1)^k)*gcd(k,n)); \\ Antti Karttunen, May 16 2021
Formula
Extensions
More terms from Antti Karttunen, May 16 2021
Comments