%I #45 Jun 24 2024 09:18:39
%S 0,1,4,16,27,256,3125,46656,65536,823543,16777216,387420489,
%T 10000000000,285311670611,7625597484987,8916100448256,302875106592253,
%U 11112006825558016,437893890380859375,18446744073709551616,827240261886336764177,39346408075296537575424,1978419655660313589123979,104857600000000000000000000
%N Perfect hyper-4 powers: a^^b, where b <> 1.
%C a^^b is the right associative power tower a^a^...^a^a of height b. a^^-1= 0 and a^^0 = 1. We exclude b=1 because otherwise all natural numbers would be in the sequence.
%e Numbers written as power towers include:
%e 5^^2 = 5^5 = 3125;
%e 3^^3 = 3^3^3 = 3^27 = 7625597484987;
%e 2^^4 = 2^2^2^2 = 2^2^4 = 2^16 = 65536;
%e 0^^5 = 0^0^0^0^0 = 0^0^0^1 = 0^0^0 = 0^1 = 0;
%p Digits := 200 ;
%p tpow := proc(a,b,logamax)
%p option remember;
%p if b = 0 then
%p 1;
%p elif b = 1 then
%p a;
%p elif b = 2 then
%p a^a;
%p else
%p # log a^procname(a,b-1) = procnmae(a,b-1)*loga
%p if evalf(procname(a,b-1,logamax)*log(a)) > evalf(logamax) then
%p return -1 ;
%p elif procname(a,b-1,logamax) < 0 then
%p return -1 ;
%p else
%p a^procname(a,b-1,logamax) ;
%p end if;
%p end if;
%p end proc:
%p A257309 := proc(amax)
%p local a,n,m,t, logamax;
%p a := {0,1} ;
%p logamax := evalf(log(amax)) ;
%p for n from 2 to amax do
%p if n^n > amax then
%p break;
%p end if;
%p for m from 2 do
%p t := tpow(n,m,logamax) ;
%p if t > amax or t < 0 then
%p break;
%p elif t <= amax and t > 0 then
%p a := a union {t} ;
%p end if;
%p end do:
%p end do:
%p sort(convert(a,list)) ;
%p end proc:
%p A257309(10^30) ; # _R. J. Mathar_, Jun 24 2024
%Y Cf. A004231, A002488.
%K nonn
%O 1,3
%A _Natan Arie Consigli_, May 07 2015