A253641 Largest integer b such that n=a^b for some integer a; a(0)=a(1)=1 by convention.
1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0
Examples
a(4) = 2 since 4 = 2^2. a(64) = 6 since 64 = 2^6 (although also 64 = 4^3 = 8^2).
Links
- Antti Karttunen, Table of n, a(n) for n = 0..10000
Programs
-
Maple
a:=proc(n) if n in {0, 1} then 1 else igcd(map(i->i[2], ifactors(n)[2])[]); fi; end: seq(a(n), n=0..120); # Ridouane Oudra, Jun 10 2025
-
PARI
A253641(n)=max(ispower(n),1)
-
Python
from math import gcd from sympy import factorint def A253641(n): return gcd(*factorint(n).values()) if n>1 else 1 # Chai Wah Wu, Aug 13 2024
Comments