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

A350223
a(n) = Sum_{k=1..n} (-1)^(k+1) * floor((n/k)^k).
4
1, 1, 2, 1, 2, 1, 2, 0, 2, 2, 3, 0, 3, 2, 4, -1, 2, 1, 1, 0, 3, 2, 2, -2, 2, -1, 2, 2, 2, -1, 3, -1, 7, 2, 2, 0, 3, 2, 4, -2, 3, -1, 1, 1, 0, 3, 5, -1, 4, 1, 1, -2, 1, 1, 5, -2, 4, -1, 4, 0, 3, 1, 1, -1, 2, 1, 3, -1, 6, -1, 2, -5, 7, 0, 1, -1, 4, -2, 8, -5, 2, 4, 1, 3, 2, 4, 2, -3, 1, 0, 2, -1, 3, 4, 0, -6, 2, -1, 6, 3, 3, 1, 5, -6, 9
OFFSET
1,3
LINKS
EXAMPLE
a(3) = [3/1] - [(3/2)^2] + [(3/3)^3] = 3 - 2 + 1 = 2.
a(4) = [4/1] - [(4/2)^2] + [(4/3)^3] - [(4/4)^4] = 4 - 4 + 2 - 1 = 1.
MATHEMATICA
a[n_] := Sum[(-1)^(k + 1)*Floor[(n/k)^k], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Dec 20 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(k+1)*(n^k\k^k));
CROSSREFS
Sequence in context: A029445 A274920 A316828 * A274820 A230583 A197366
KEYWORD
sign
AUTHOR
Seiichi Manyama, Dec 20 2021
STATUS
approved