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 - ... .
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
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).
Links
- Friedjof Tellkamp, Table of n, a(n) for n = 1..10000
- Solomon W. Golomb, A new arithmetic function of combinatorial significance, J. Number Theory, Vol. 5, No. 3 (1973), pp. 218-223.
Crossrefs
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