OFFSET
1,1
COMMENTS
a(15) is the first term not an eighth or ninth power.
EXAMPLE
390625 is a term because it equals 5^(2^3).
118587876497 is a term because it equals 17^(3^2).
MAPLE
N:= 10^20: # for terms <= N
with(priqueue):
initialize(pq):
if 2^(3^5) < N then insert([-2^(3^5), 2, 3, 5], pq) fi:
if 2^(5^3) < N then insert([-2^(5^3), 2, 5, 3], pq) fi:
if 3^(2^5) < N then insert([-3^(2^5), 3, 2, 5], pq) fi:
if 3^(5^2) < N then insert([-3^(5^2), 3, 5, 2], pq) fi:
if 5^(2^3) < N then insert([-5^(2^3), 5, 2, 3], pq) fi:
if 5^(3^2) < N then insert([-5^(3^2), 5, 3, 2], pq) fi:
Res:= NULL:
while pq[0] > 0 do
t:= extract(pq);
Res:= Res, -t[1];
q:= nextprime(t[2]);
while member(q, {t[3], t[4]}) do q:= nextprime(q) od;
v:= q^(t[3]^t[4]);
if v <= N then insert([-v, q, t[3], t[4]], pq) fi;
if t[2] = 2 then
q:= nextprime(t[3]);
if q = t[4] then q:= nextprime(q) fi;
v:= 2^(q^t[4]);
if v <= N then insert([-v, 2, q, t[4]], pq) fi;
fi;
if {t[2], t[3]} = {2, 3} then
q:= nextprime(t[4]);
v:= t[2]^(t[3]^q);
if v <= N then insert([-v, t[2], t[3], q], pq) fi;
fi
od:
Res; # Robert Israel, Aug 27 2024
MATHEMATICA
seq[max_] := Module[{ps = Select[Range[Floor[Surd[max, 8]]], PrimeQ], t}, t = Select[Tuples[ps, {3}], UnsameQ @@ # &]; t = Select[t, #[[1]] < Surd[max, (#[[2]]^#[[3]])] &]; Sort[Select[(#[[1]]^(#[[2]]^#[[3]])) & /@ t, # <= max &]]]; seq[10^14] (* Amiram Eldar, Aug 27 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Duckett, Aug 25 2024
STATUS
approved