%I #10 Nov 27 2017 12:07:37
%S 1,1,1,2,1,1,1,2,2,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,
%T 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,
%U 1,1,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1
%N Number of ways to write n as a finite power-tower of positive integers greater than one, allowing both left and right nesting of parentheses.
%H R. J. Mathar, <a href="/A294338/b294338.txt">Table of n, a(n) for n = 1..10000</a>
%e The a(16) = 5 ways are: 16, 4^2, (2^2)^2, 2^4, 2^(2^2).
%p A294338 := proc(n)
%p local expo,g,a,d ;
%p if n =1 then
%p return 1;
%p end if;
%p # compute gcd of the set of prime power exponents (A052409)
%p ifactors(n)[2] ;
%p [ seq(op(2,ep),ep=%)] ;
%p igcd(op(%)) ;
%p # set of divisors of A052409 (without the 1)
%p g := numtheory[divisors](%) minus {1} ;
%p a := 0 ;
%p for d in g do
%p # recursive (sort of convolution) call
%p a := a+ procname(d)*procname(root[d](n)) ;
%p end do:
%p 1+a ;
%p end proc:
%p seq(A294338(n),n=1..120) ; # _R. J. Mathar_, Nov 27 2017
%t a[n_]:=1+Sum[a[n^(1/g)]*a[g],{g,Rest[Divisors[GCD@@FactorInteger[n][[All,2]]]]}];
%t Array[a,100]
%Y Cf. A001597, A007916, A052409, A052410, A089723, A164336, A277562, A284639, A288636, A294336, A294337, A294339.
%K nonn
%O 1,4
%A _Gus Wiseman_, Oct 28 2017