%I #24 Oct 21 2023 20:03:10
%S 1,3,7,11,17,25,33,41,54,66,78,94,108,124,148,164,182,208,228,252,284,
%T 308,332,364,395,423,463,495,525,573,605,637,685,721,769,821,859,899,
%U 955,1003,1045,1109,1153,1201,1279,1327,1375,1439,1496,1558,1630,1686,1740,1820
%N Partial sums of A002131.
%F a(n) = Sum_{k=1..n} Sum_{d|k, k/d odd} d = Sum_{k=1..n} A002131(k).
%F G.f.: (1/(1 - x)) * Sum_{k>=1} k * x^k/(1 - x^(2*k)).
%F a(n) ~ (Pi^2/16) * n^2. - _Amiram Eldar_, Dec 17 2021
%F a(n) = A024916(n) - A024916(floor(n/2)). - _Chai Wah Wu_, Dec 17 2021
%t f[2, e_] := 2^e; f[p_, e_] := (p^(e + 1) - 1)/(p - 1); s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate @ Array[s, 50] (* _Amiram Eldar_, Dec 17 2021 *)
%o (PARI) a(n) = sum(k=1, n, sumdiv(k, d, k/d%2*d));
%o (PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, k*x^k/(1-x^(2*k)))/(1-x))
%o (Python)
%o def A350146(n): return sum(k*(n//k) for k in range(1,n+1))-sum(k*(n//2//k) for k in range(1,n//2+1)) # _Chai Wah Wu_, Dec 17 2021
%o (Python)
%o from math import isqrt
%o def A350146(n): return (-(s:=isqrt(n))**2*(s+1) + sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))+(t:=isqrt(m:=n>>1))**2*(t+1) - sum((q:=m//k)*((k<<1)+q+1) for k in range(1,t+1)))>>1 # _Chai Wah Wu_, Oct 21 2023
%Y Cf. A002131, A024916, A222068.
%K nonn
%O 1,2
%A _Seiichi Manyama_, Dec 16 2021