login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A304481
Turn the power-tower for n upside-down.
4
1, 2, 3, 4, 5, 6, 7, 9, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 32, 26, 27, 28, 29, 30, 31, 25, 33, 34, 35, 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 128, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 36, 65, 66, 67
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).
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}]
KEYWORD
nonn,look
AUTHOR
Gus Wiseman, May 13 2018
STATUS
approved