OFFSET
1,2
COMMENTS
This is an involution of the positive integers.
The power-tower for n is defined as follows. 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)^...^c(x_3)^c(x_2)^c(x_1).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The power tower of 81 is 3^2^2, which turned upside-down is 2^2^3 = 256, so a(81) = 256.
MAPLE
f:= proc(n, r) local F, a, y;
if n = 1 then return 1 fi;
F:= ifactors(n)[2];
y:= igcd(seq(t[2], t=F));
if y = 1 then return n^r fi;
a:= mul(t[1]^(t[2]/y), t=F);
procname(y, a^r)
end proc:
seq(f(n, 1), n=1..100); # Robert Israel, May 13 2018
MATHEMATICA
tow[n_]:=If[n==1, {}, With[{g=GCD@@FactorInteger[n][[All, 2]]}, If[g===1, {n}, Prepend[tow[g], n^(1/g)]]]];
Table[Power@@Reverse[tow[n]], {n, 100}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Gus Wiseman, May 13 2018
STATUS
approved