login
a(n) = Sum_{k=1..d(n)-1} gcd(b(k), b(k+1)), where b(k) is the k-th positive divisor of n and d(n) is the number of positive divisors of n.
4

%I #21 Dec 29 2023 10:48:40

%S 0,1,1,3,1,5,1,7,4,7,1,11,1,9,7,15,1,17,1,19,9,13,1,23,6,15,13,25,1,

%T 26,1,31,13,19,9,35,1,21,15,37,1,41,1,37,21,25,1,47,8,37,19,43,1,53,

%U 13,49,21,31,1,57,1,33,27,63,15,61,1,55,25,48,1,71,1,39,37,61,13,71,1,73,40

%N a(n) = Sum_{k=1..d(n)-1} gcd(b(k), b(k+1)), where b(k) is the k-th positive divisor of n and d(n) is the number of positive divisors of n.

%C a(n) is the sum of the terms in row n of A136178.

%H Michael De Vlieger, <a href="/A136180/b136180.txt">Table of n, a(n) for n = 1..10000</a>

%e The positive divisors of 20 are 1,2,4,5,10,20; gcd(1,2)=1, gcd(2,4)=2, gcd(4,5)=1, gcd(5,10)=5, and gcd(10,20)=10, so a(20) = 1+2+1+5+10 = 19.

%p with(numtheory): a:=proc(n) local div: div:=divisors(n): add(gcd(div[k], div[k+1]),k=1..tau(n)-1) end proc: seq(a(n),n=1..70); # _Emeric Deutsch_, Jan 08 2008

%t Array[Total@ Map[GCD @@ # &, Partition[#, 2, 1] &@ Divisors@ #] &, 81] (* _Michael De Vlieger_, Oct 16 2017 *)

%o (PARI) a(n) = my(d=divisors(n)); vecsum(vector(#d-1, k, gcd(d[k], d[k+1]))); \\ _Michel Marcus_, Oct 16 2017

%Y Cf. A136178, A136179, A136183.

%K nonn

%O 1,4

%A _Leroy Quet_, Dec 19 2007

%E More terms from _Emeric Deutsch_, Jan 08 2008

%E Terms beyond a(70) from _R. J. Mathar_, Feb 27 2010