login
A350162
a(n) = Sum_{k=1..n} (-1)^(k+1) * floor(n/(2*k-1))^2.
2
1, 4, 8, 15, 25, 33, 45, 60, 73, 95, 115, 131, 157, 181, 205, 236, 270, 297, 333, 379, 403, 443, 487, 519, 578, 632, 672, 720, 778, 826, 886, 949, 989, 1059, 1131, 1186, 1260, 1332, 1388, 1482, 1564, 1612, 1696, 1776, 1858, 1946, 2038, 2102, 2187, 2308, 2380, 2490
OFFSET
1,2
LINKS
FORMULA
a(n) = Sum_{k=1..n} Sum_{d|k} A101455(k/d) * (2*d - 1) = Sum_{k=1..n} 2 * A050469(k) - A002654(k) = 2 * A350166(n) - A014200(n).
G.f.: (1/(1 - x)) * Sum_{k>=1} (2*k - 1) * x^k/(1 + x^(2*k)).
MATHEMATICA
a[n_] := Sum[(-1)^(k + 1) * Floor[n/(2*k - 1)]^2, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, Dec 18 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(k+1)*(n\(2*k-1))^2);
(PARI) a(n) = sum(k=1, n, sumdiv(k, d, kronecker(-4, k/d)*(2*d-1)));
(PARI) my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, (2*k-1)*x^k/(1+x^(2*k)))/(1-x))
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 18 2021
STATUS
approved