login
An alternating sum of greatest common divisors.
5

%I #27 Mar 30 2024 03:01:59

%S 1,0,1,-4,1,-8,1,-16,-3,-16,1,-36,1,-24,-15,-48,1,-48,1,-68,-23,-40,1,

%T -112,-15,-48,-27,-100,1,-120,1,-128,-39,-64,-47,-180,1,-72,-47,-208,

%U 1,-176,1,-164,-99,-88,1,-304,-35,-160,-63,-196,1,-216,-79,-304,-71,-112,1,-420,1,-120,-147,-320,-95,-288,1,-260,-87

%N An alternating sum of greatest common divisors.

%C With interpolated 0's, this is Sum_{k=0..n} gcd(n-k+1,k+1)*(-1)^k.

%H Antti Karttunen, <a href="/A106475/b106475.txt">Table of n, a(n) for n = 0..16384</a>

%F a(n) = Sum_{k=0..2*n} gcd(2*n-k+1, k+1)*(-1)^k.

%F a(n) = 2(n+1) - A344371(2(n+1)) = 2(n+1) - A344372(n+1) = 2(n+1) + A199084(2(n+1)). - _Max Alekseyev_, May 16 2021

%F Sum_{k=1..n} a(k) ~ n^2 * (1 - (4/Pi^2)*(log(n) + 2*gamma - 1/2 - log(2)/3 - zeta'(2)/zeta(2))), where gamma is Euler's constant (A001620). - _Amiram Eldar_, Mar 30 2024

%t Table[Sum[GCD[2n-k+1,k+1](-1)^k,{k,0,2n}],{n,0,100}] (* _Giorgos Kalogeropoulos_, Mar 31 2021 *)

%o (PARI) A106475(n) = sum(k=0,(2*n),gcd(1+n+n-k, k+1)*((-1)^k)); \\ _Antti Karttunen_, Mar 30 2021

%Y Cf. A001620, A003989, A006579, A199084, A306016, A344371, A344372.

%Y Negated bisection of A344373.

%K easy,sign

%O 0,4

%A _Paul Barry_, May 03 2005

%E More terms from _Antti Karttunen_, Mar 30 2021