OFFSET
1,2
FORMULA
MAPLE
b:= n-> add(d, d=select(x-> x::odd, numtheory[divisors](n))):
a:= proc(n) option remember; n+`if`(n<2, 0, a(n-1))-b(n-1) end:
seq(a(n), n=1..60); # Alois P. Heinz, May 25 2020
MATHEMATICA
Table[Sum[Mod[Ceiling[n/k], 2] k, {k, 1, n}], {n, 1, 60}]
Table[n (n + 1)/2 - Sum[DivisorSum[k, (-1)^(k/# + 1) # &], {k, 1, n - 1}], {n, 1, 60}]
nmax = 60; CoefficientList[Series[x/(1 - x) (1/(1 - x)^2 - Sum[k x^k/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
PROG
(PARI) a(n) = sum(k=1, n, (ceil(n/k) % 2)*k); \\ Michel Marcus, May 26 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 25 2020
STATUS
approved