This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A217727 #20 Nov 22 2016 21:53:59 %S A217727 2,4,16,256,5,25,3,9,81,6561,8,64,4096,16777216,281474976710656,33, %T A217727 1089,6,36,1296,7,49,2401,5764801,15,225,50625,10,100,10000,100000000, %U A217727 18,324,104976,11,121,14641,214358881,19,361,130321,16983563041,23,529,279841,12,144,20736,429981696,184884258895036416,39 %N 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. %C A217727 Does every number >= 2 appear? %C A217727 Suggested by a posting to the Math Fun Mailing List by Keith F. Lynch, Mar 21 2013. %C A217727 See A277848 for the index of a given number, i.e., the left inverse of this function. - _M. F. Hasler_, Nov 20 2016 %H A217727 Alois P. Heinz, <a href="/A217727/b217727.txt">Table of n, a(n) for n = 1..662</a> %p A217727 Digits:=100; %p A217727 a1:=[2,4,16]; %p A217727 s1:=convert(a1,set); %p A217727 for n from 3 to 50 do %p A217727 t1:=a1[n]; %p A217727 k:=floor(log(t1)); %p A217727 if k >= 2 then %p A217727 if evalb(k in s1) then a1:=[op(a1),t1^2]; s1:= s1 union {t1^2} %p A217727 else a1:=[op(a1),k]; s1 := s1 union {k}; fi; %p A217727 else %p A217727 a1:=[op(a1),t1^2]; s1:= s1 union {t1^2}; %p A217727 fi; %p A217727 od: %p A217727 [seq(a1[i],i=1..nops(a1))]; %t A217727 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 *) %o A217727 (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 %Y A217727 Cf. A114183. %K A217727 nonn %O A217727 1,1 %A A217727 _N. J. A. Sloane_, Mar 21 2013