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.

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