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.

Showing 1-2 of 2 results.

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

A382691 Alternating sum of the characteristic functions of k-th powers, with k >= 2: characteristic function of squares - c.f. of cubes + c.f. of 4th powers - ... .

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 1

Views

Author

Friedjof Tellkamp, Apr 05 2025

Keywords

Examples

			n:           1, 2, 3, 4, 5, 6, 7, 8, 9, ...
Squares (+): 1, 0, 0, 1, 0, 0, 0, 0, 1, ... (A010052)
Cubes   (-): 1, 0, 0, 0, 0, 0, 0, 1, 0, ... (A010057)
...
Sum:         0, 0, 0, 1, 0, 0, 0,-1, 1, ... (= this sequence).
		

Crossrefs

Cf. A089723 (nonalternating, k>=1), A259362 (nonalternating, k>=2).

Programs

  • Mathematica
    Table[Sum[(-1)^k Boole[IntegerQ[n^(1/k)]], {k, 2, Floor[Log[2, n]]}], {n, 1, 100}]
  • PARI
    a(n) = sum(i=2, logint(n,2), (-1)^i*ispower(n, i)); \\ Michel Marcus, Apr 11 2025

Formula

a(n) = A010052(n) - A010057(n) + A374016(n) - (...).
Sum_{i=1..n} a(i) = A381042(n).
G.f.: Sum_{j>=1, k>=2} (-1)^k * x^(j^k).
Sum_{n>=1} a(n)/n = 1/2.
Dirichlet g.f.: Sum_{k>=2} (-1)^k * zeta(k*s) = Sum_{k>=1} (zeta(2*k*s) - zeta((2*k+1)*s)).
Showing 1-2 of 2 results.