login
A190613
a(n) = Sum_{k=1..n} (-1)^(n-floor(n/k)) * floor(n/k).
2
0, 1, 1, 5, 4, 6, 2, 12, 12, 11, 1, 21, 17, 9, 7, 37, 18, 16, 10, 28, 30, 30, -6, 52, 48, 11, 17, 59, 19, 39, 9, 53, 65, 27, 9, 83, 44, 30, 10, 98, 54, 28, 36, 50, 68, 82, -34, 128, 98, 13, 49, 91, 47, 59, 21, 119, 85, 71, -11, 129, 107, 15, 49, 153, 92, 72, 24, 110, 68, 120, -24, 166, 166, -20
OFFSET
0,4
LINKS
MATHEMATICA
Table[Sum[(-1)^(n-Floor[n/k] ) Floor[n/k], {k, n}], {n, 0, 80}] (* Harvey P. Dale, May 01 2018 *)
PROG
(PARI) a(n)=sum(k=1, n, (-1)^(n-n\k)*(n\k))
(Python)
from math import floor
def A190613(n):
z = 0
for k in range(1, n+1):
x = floor(n/k)
y = ((-1)**(n-x))*x
z += y
return(z) # John Tyler Rascoe, Feb 19 2023
CROSSREFS
Sequence in context: A255291 A070365 A368666 * A161011 A232734 A298513
KEYWORD
sign,look
AUTHOR
STATUS
approved