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”).

A309124
a(n) = n - 3 * floor(n/3) + 5 * floor(n/5) - 7 * floor(n/7) + ...
2
1, 2, 0, 1, 7, 5, -1, 0, 7, 13, 3, 1, 15, 9, -3, -2, 16, 23, 5, 11, 23, 13, -9, -11, 20, 34, 14, 8, 38, 26, -4, -3, 17, 35, -1, 6, 44, 26, -2, 4, 46, 58, 16, 6, 48, 26, -20, -22, 21, 52, 16, 30, 84, 64, 4, -2, 34, 64, 6, -6, 56, 26, -16, -15, 69, 89, 23, 41, 85, 49, -21, -14, 60, 98, 36
OFFSET
1,2
COMMENTS
Partial sums of A050457.
LINKS
FORMULA
G.f.: (1/(1 - x)) * Sum_{k>=1} (-1)^(k+1) * (2*k - 1) * x^(2*k-1)/(1 - x^(2*k-1)).
MAPLE
f:= proc(n) local r, d;
r:= n/2^padic:-ordp(n, 2);
add((-1)^((d-1)/2)*d, d = numtheory:-divisors(r))
end proc:
ListTools:-PartialSums(map(f, [$1..100])); # Robert Israel, Oct 28 2020
MATHEMATICA
Table[Sum[(-1)^(k + 1) (2 k - 1) Floor[n/(2 k - 1)], {k, 1, n}], {n, 1, 75}]
nmax = 75; CoefficientList[Series[1/(1 - x) Sum[(-1)^(k + 1) (2 k - 1) x^(2 k - 1)/(1 - x^(2 k - 1)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Jul 13 2019
STATUS
approved