login
Largest integer b such that n=a^b for some integer a; a(0)=a(1)=1 by convention.
6

%I #24 Aug 14 2024 01:50:55

%S 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,

%T 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,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1

%N Largest integer b such that n=a^b for some integer a; a(0)=a(1)=1 by convention.

%C A000005(a(n))-1 yields the number of times n is listed in A072103, i.e., the number of ways it can be written differently as perfect power.

%C The same as A052409 if the convention is dropped. - _R. J. Mathar_, Jan 29 2015

%H Antti Karttunen, <a href="/A253641/b253641.txt">Table of n, a(n) for n = 0..10000</a>

%e a(4) = 2 since 4 = 2^2. a(64) = 6 since 64 = 2^6 (although also 64 = 4^3 = 8^2).

%e For any n, a(n) >= 1 since n = n^1.

%e Integers n = 0 and n = 1 can be written as n^b with arbitrarily large b; to remain consistent with the preceding formula and the comment, the conventional choice a(n) = 1 seemed the best one.

%o (PARI) A253641(n)=max(ispower(n),1)

%o (Python)

%o from math import gcd

%o from sympy import factorint

%o def A253641(n): return gcd(*factorint(n).values()) if n>1 else 1 # _Chai Wah Wu_, Aug 13 2024

%Y Cf. A001597, A072103, A175064, A253642.

%K nonn,easy

%O 0,5

%A _M. F. Hasler_, Jan 25 2015