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.

A381042 Alternating sum of floor(n^(1/k)), with k >= 2.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7
Offset: 0

Views

Author

Friedjof Tellkamp, Apr 14 2025

Keywords

Examples

			n:       0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
k=2 (+): 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, ... (A000196)
k=3 (-): 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, ... (A048766)
...
Sum:     0, 0, 0, 0, 1, 1, 1, 1, 0, 1 ... (= this sequence).
		

Crossrefs

Cf. A000196 (k=2), A048766 (k=3), A255270 (k=4), A178487 (k=5), A178489 (k=6).
Cf. A089361 (nonalternating), A382691, A382692.

Programs

  • Mathematica
    z = 100; Table[Sum[(-1)^k Floor[n^(1/k)], {k, 2, 2 Floor@Log[2, z/2] - 1}], {n, 0, z}]

Formula

a(n) = A000196(n) - A048766(n) + A255270(n) - A178487(n) + ... .
a(n) = Sum_{k>=2} (-1)^k * floor(n^(1/k)) = Sum_{k>=1} (floor(n^(1/(2*k))) - floor(n^(1/(2*k+1)))).
a(n) = Sum_{i=1..n} A382691(i).
a(n) ~ A382692(n).
G.f.: Sum_{j>=1, k>=2} (-1)^k * x^(j^k)/(1-x).