A259362 a(1) = 1, for n > 1: a(n) is the number of ways to write n as a nontrivial perfect power.
1, 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, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Examples
a(6) = 0 because there is no way to write 6 as a nontrivial perfect power. a(9) = 1 because there is one way to write 9 as a nontrivial perfect power: 3^2. a(16) = 2 because there are two ways to write 16 as a nontrivial perfect power: 2^4, 4^2. From _Friedjof Tellkamp_, Jun 14 2025: (Start) 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: oo, 0, 0, 1, 0, 0, 0, 1, 1, ... a(1)=1: 1, 0, 0, 1, 0, 0, 0, 1, 1, ... (= this sequence). (End)
Links
- Doug Bell, Table of n, a(n) for n = 1..5000
Crossrefs
Programs
-
Mathematica
a[n_] := If[n == 1, 1, Sum[Boole[IntegerQ[n^(1/k)]], {k, 2, Floor[Log[2, n]]}]]; Array[a, 100] (* Friedjof Tellkamp, Jun 14 2025 *) a[n_] := If[n == 1, 1, DivisorSigma[0, Apply[GCD, Transpose[FactorInteger[n]][[2]]]] - 1]; Array[a, 100] (* Michael Shamos, Jul 06 2025 *)
-
PARI
a(n) = if (n==1, 1, sum(i=2, logint(n, 2), ispower(n, i))); \\ Michel Marcus, Apr 11 2025
Formula
From Friedjof Tellkamp, Jun 14 2025: (Start)
a(n) = A089723(n) - 1, for n > 1.
Sum_{k>=2..n} a(k) = A089361(n), for n > 1.
G.f.: x + Sum_{j>=2, k>=2} x^(j^k).
Dirichlet g.f.: 1 + Sum_{k>=2} zeta(k*s)-1. (End)
Comments