Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #25 Mar 05 2024 07:45:30
%S 0,1,2,3,4,8,6,7,14,14,10,20,12,20,36,15,16,41,18,34,52,32,22,44,44,
%T 38,68,48,28,96,30,31,84,50,92,95,36,56,100,74,40,136,42,76,192,68,46,
%U 92,90,119,132,90,52,176,148,104,148,86,58,216,60,92,274,63,176,216
%N a(n) = Sum_{d|n, d odd} (n-d).
%C Total distance from n to each odd divisor of n.
%H Robert Israel, <a href="/A367870/b367870.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A245579(n) - A000593(n).
%F a(n) = n*A001227(n) - A000593(n).
%e a(15) = 36. The total distance from 15 to each of its odd divisors is (15-1) + (15-3) + (15-5) + (15-15) = 36.
%p f:= proc(n) local x,d;
%p x:= n/2^padic:-ordp(n,2);
%p add(n-d, d = numtheory:-divisors(x))
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Dec 04 2023
%t Table[DivisorSum[n, n-# &, OddQ], {n, 100}] (* _Paolo Xausa_, Mar 05 2024 *)
%o (PARI) a(n) = sumdiv(n, d, if (d%2, n-d)); \\ _Michel Marcus_, Dec 04 2023
%o (Python)
%o from math import prod
%o from sympy import factorint
%o def A367870(n):
%o f = factorint(n>>(~n&n-1).bit_length())
%o return n*prod(e+1 for e in f.values())-prod((p**(e+1)-1)//(p-1) for p,e in f.items()) # _Chai Wah Wu_, Dec 31 2023
%Y Cf. A000593, A001227, A094471, A245579.
%K nonn,look
%O 1,3
%A _Wesley Ivan Hurt_, Dec 03 2023