A217727 a(1)=2. For n >= 1, let k = floor(log a(n)). If k >= 2 and k is not already in the sequence then a(n+1)=k, otherwise a(n+1)=a(n)^2.
2, 4, 16, 256, 5, 25, 3, 9, 81, 6561, 8, 64, 4096, 16777216, 281474976710656, 33, 1089, 6, 36, 1296, 7, 49, 2401, 5764801, 15, 225, 50625, 10, 100, 10000, 100000000, 18, 324, 104976, 11, 121, 14641, 214358881, 19, 361, 130321, 16983563041, 23, 529, 279841, 12, 144, 20736, 429981696, 184884258895036416, 39
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..662
Crossrefs
Cf. A114183.
Programs
-
Maple
Digits:=100; a1:=[2,4,16]; s1:=convert(a1,set); for n from 3 to 50 do t1:=a1[n]; k:=floor(log(t1)); if k >= 2 then if evalb(k in s1) then a1:=[op(a1),t1^2]; s1:= s1 union {t1^2} else a1:=[op(a1),k]; s1 := s1 union {k}; fi; else a1:=[op(a1),t1^2]; s1:= s1 union {t1^2}; fi; od: [seq(a1[i],i=1..nops(a1))];
-
Mathematica
a = {2}; Do[If[And[# >= 2, ! MemberQ[a, #]], AppendTo[a, #], AppendTo[a, a[[n]]^2]] &@ Floor@ Log@ a[[n]], {n, 50}]; a (* Michael De Vlieger, Nov 22 2016 *)
-
PARI
A217727(n,show_all=0,a=2,u=[])={for(i=2,n, show_all&&print1(a","); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1]); my(t=log(a)\1); a=if(t>u[1]&&!setsearch(u, t), t, a^2));a} \\ M. F. Hasler, Nov 22 2016
Comments