OFFSET
1,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{i=1..n} floor((n-i)/i)*(-1)^(i+1). - Wesley Ivan Hurt, Sep 13 2017
a(n) = Sum_{i=2..n} (floor(n/i) mod 2) = A059851(n) - (n mod 2). - Ridouane Oudra, Oct 20 2019
a(n) ~ log(2) * n. - Vaclav Kotesovec, May 28 2021
MAPLE
seq(add(floor(n/k)-2*floor(n/(2*k)), k=2..n), n=1..60); # Ridouane Oudra, Oct 20 2019
MATHEMATICA
Table[Sum[Floor[n/k] - 2*Floor[n/(2*k)], {k, 2, n}], {n, 1, 50}] (* G. C. Greubel, Jul 30 2016 *)
PROG
(Sage)
[sum([floor(n/k) - 2*floor(n/(2*k)) for k in (2..n)]) for n in (1..69)]
(PARI) a(n)=sum(k=2, n, n\k) - 2*sum(k=2, n\2, n\(2*k)) \\ Charles R Greathouse IV, Jul 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Luschny, Jul 30 2016
STATUS
approved