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.

A075802 Characteristic function of perfect powers, A001597.

This page as a plain text file.
%I A075802 #29 Mar 11 2025 18:06:52
%S A075802 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,
%T A075802 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,
%U A075802 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
%N A075802 Characteristic function of perfect powers, A001597.
%C A075802 Not multiplicative: for example, a(8)=a(9)=1, but a(72)=0. - _Franklin T. Adams-Watters_, Sep 09 2005
%H A075802 Reinhard Zumkeller, <a href="/A075802/b075802.txt">Table of n, a(n) for n = 1..10000</a>
%H A075802 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectPower.html">Perfect Powers</a>.
%H A075802 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F A075802 a(n) = A057427(A052409(n) - 1);
%F A075802 a(A001597(n))=1 and a(A007916(n))=0.
%t A075802 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 *)
%o A075802 (Haskell)
%o A075802 a075802 1 = 1
%o A075802 a075802 n = signum $ a052409 n - 1  -- _Reinhard Zumkeller_, May 26 2012
%o A075802 (Python)
%o A075802 from sympy import perfect_power
%o A075802 def A075802(n): return int(bool(perfect_power(n))) if n>1 else 1 # _Chai Wah Wu_, Mar 11 2025
%Y A075802 Cf. A001597, A007916, A052409, A057427, A072292, A112526.
%K A075802 nonn
%O A075802 1,1
%A A075802 _Reinhard Zumkeller_, Oct 13 2002