This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A367870 #28 Feb 21 2025 20:04:00 %S A367870 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 A367870 38,68,48,28,96,30,31,84,50,92,95,36,56,100,74,40,136,42,76,192,68,46, %U A367870 92,90,119,132,90,52,176,148,104,148,86,58,216,60,92,274,63,176,216 %N A367870 a(n) = Sum_{d|n, d odd} (n-d). %C A367870 Total distance from n to each odd divisor of n. %H A367870 Robert Israel, <a href="/A367870/b367870.txt">Table of n, a(n) for n = 1..10000</a> %F A367870 a(n) = A245579(n) - A000593(n). %F A367870 a(n) = n*A001227(n) - A000593(n). %e A367870 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 A367870 f:= proc(n) local x,d; %p A367870 x:= n/2^padic:-ordp(n,2); %p A367870 add(n-d, d = numtheory:-divisors(x)) %p A367870 end proc: %p A367870 map(f, [$1..100]); # _Robert Israel_, Dec 04 2023 %t A367870 Table[DivisorSum[n, n-# &, OddQ], {n, 100}] (* _Paolo Xausa_, Mar 05 2024 *) %o A367870 (PARI) a(n) = sumdiv(n, d, if (d%2, n-d)); \\ _Michel Marcus_, Dec 04 2023 %o A367870 (Python) %o A367870 from math import prod %o A367870 from sympy import factorint %o A367870 def A367870(n): %o A367870 f = factorint(n>>(~n&n-1).bit_length()) %o A367870 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 A367870 Cf. A000593, A001227, A094471, A245579. %K A367870 nonn,look %O A367870 1,3 %A A367870 _Wesley Ivan Hurt_, Dec 03 2023