OFFSET
1,1
COMMENTS
Does every number >= 2 appear?
Suggested by a posting to the Math Fun Mailing List by Keith F. Lynch, Mar 21 2013.
See A277848 for the index of a given number, i.e., the left inverse of this function. - M. F. Hasler, Nov 20 2016
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..662
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 21 2013
STATUS
approved