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_{d|n, phi(d)|sigma(d)} (n-d).
0

%I #6 May 02 2023 23:54:22

%S 0,1,2,5,4,12,6,13,14,17,10,36,12,25,26,29,16,60,18,37,38,41,22,96,24,

%T 49,50,67,28,123,30,61,62,65,34,156,36,73,74,77,40,184,42,85,116,89,

%U 46,216,48,97,98,101,52,204,54,151,110,113,58,351,60,121,122,125,64,252,66,133

%N a(n) = Sum_{d|n, phi(d)|sigma(d)} (n-d).

%C Total distance from n to each balanced divisor of n (see example).

%F a(n) = Sum_{d|n} (n-d) * A351114(d).

%F a(n) = n*A351112(n) - A351113(n).

%e a(12) = 36; 12 has 5 balanced divisors 1,2,3,6,12 and the sum of their distances to n is (12-1)+(12-2)+(12-3)+(12-6)+(12-12) = 36.

%t a[n_] := DivisorSum[n, (n - #) &, Divisible[DivisorSigma[1, #], EulerPhi[#]] &]; Array[a, 100]

%o (PARI) a(n) = sumdiv(n, d, if (!(sigma(d) % eulerphi(d)), n-d)); \\ _Michel Marcus_, Apr 30 2023

%Y Cf. A000005 (tau), A000010 (phi), A020492 (balanced numbers), A351112, A351113, A351114.

%K nonn,easy

%O 1,3

%A _Wesley Ivan Hurt_, Apr 30 2023