cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350223 a(n) = Sum_{k=1..n} (-1)^(k+1) * floor((n/k)^k).

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Dec 20 2021

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-1)^(k + 1)*Floor[(n/k)^k], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Dec 20 2021 *)
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*(n^k\k^k));