A075802 Characteristic function of perfect powers, A001597.
1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
Offset: 1
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Perfect Powers.
- Index entries for characteristic functions
Programs
-
Haskell
a075802 1 = 1 a075802 n = signum $ a052409 n - 1 -- Reinhard Zumkeller, May 26 2012
-
Mathematica
a[n_] := Boole[GCD @@ FactorInteger[n][[All, 2]] > 1]; a[1] = 1; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Dec 12 2011 *)
-
Python
from sympy import perfect_power def A075802(n): return int(bool(perfect_power(n))) if n>1 else 1 # Chai Wah Wu, Mar 11 2025
Comments