login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Sum_{p|n, p prime} Sum_{d|n} gcd(d,p).
4

%I #16 Dec 06 2022 03:22:15

%S 0,3,4,5,6,14,8,7,7,18,12,22,14,22,20,9,18,23,20,28,24,30,24,30,11,34,

%T 10,34,30,52,32,11,32,42,28,36,38,46,36,38,42,60,44,46,32,54,48,38,15,

%U 31,44,52,54,32,36,46,48,66,60,80,62,70,38,13,40,76,68,64,56,68,72,49

%N a(n) = Sum_{p|n, p prime} Sum_{d|n} gcd(d,p).

%H Robert Israel, <a href="/A351711/b351711.txt">Table of n, a(n) for n = 1..10000</a>

%F a(p) = p + 1, p prime.

%F a(n) = tau(n)*omega(n) + Sum_{p|n, p prime} (p-1)*tau(n/p).

%e a(6) = 14; a(6) = Sum_{p|6, p prime} Sum_{d|6} gcd(d,p) = gcd(1,2) + gcd(2,2) + gcd(3,2) + gcd(6,2) + gcd(1,3) + gcd(2,3) + gcd(3,3) + gcd(6,3) = 1 + 2 + 1 + 2 + 1 + 1 + 3 + 3 = 14.

%p f:= proc(n) local p, P; uses numtheory;

%p P:= factorset(n);

%p tau(n)*nops(P)+add((p-1)*tau(n/p),p=P);

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Dec 05 2022

%o (PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, (f[k,1]-1)*numdiv(n/f[k,1])) + omega(f)*numdiv(f); \\ _Michel Marcus_, Feb 18 2022

%Y Cf. A001221 (omega), A000005 (tau), A351758.

%K nonn,look

%O 1,2

%A _Wesley Ivan Hurt_, Feb 16 2022