OFFSET
1,2
COMMENTS
Let {c(i)} = A007916 denote the sequence of numbers > 1 which are not perfect powers. Every positive integer n has a unique representation as a tower n = c(x_1)^c(x_2)^c(x_3)^...^c(x_k), where the exponents are nested from the right. Then a(n) = c(x_k).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
EXAMPLE
We have 16 = 2^2^2, so a(16) = 2.
We have 64 = 2^6, so a(64) = 6.
We have 81 = 3^2^2, so a(81) = 2.
We have 256 = 2^2^3, so a(256) = 3.
MATHEMATICA
a[n_]:=If[n==1, 1, With[{g=GCD@@FactorInteger[n][[All, 2]]}, If[g==1, n, a[g]]]];
Array[a, 100]
PROG
(PARI) a(n)={my(t=n); while(t, n=t; t=ispower(t)); n} \\ Andrew Howroyd, Aug 26 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 13 2018
STATUS
approved