OFFSET
1,1
COMMENTS
Lexicographically earliest sequence of distinct nonnegative integers with no term being the result of any term raised to the power of any term. - Peter Munn, Mar 15 2018
LINKS
Anders Hellström and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 1000 terms from Hellström)
Anders Hellström, Sage program
Anders Hellström, Mercury program
Anders Hellström, Ruby program
FORMULA
a(n) = n + sqrt(n) + O(n^(1/3)). - Charles R Greathouse IV, Aug 18 2015
EXAMPLE
After 2, we have to avoid 2^2 = 4, so 3 works.
After 2,3 we have to avoid 2^2=4, 2^3=8, 3^2=9, 3^3=27, so 5 works,also 6, also 7. Then 10, 11 and so on.
Note that 16 is the term after 15, because 2^4 and 4^2 are not excluded (since 4 is not in the sequence).
PROG
(PARI) first(m)=my(v=vector(m), x, r, n, s); v[1]=2; for(n=2, m, v[n]=v[n-1]+1; until(x==1, for(r=1, n-1, for(s=1, n-1, if((v[r]^v[s])===v[n]||(v[s]^v[r])===v[n], v[n]++; x=0; break(2), x=1))))); v;
(PARI) list(lim)=if(lim<5, return(if(lim<3, if(lim<2, [], [2]), [2, 3]))); my(u=list(max(sqrtint(lim\=1), 3)), v=vectorsmall(lim\=1, i, 1), r, m, t); for(i=2, #u, v[i]=!!setsearch(u, i)); for(r=1, #u, if(2^u[r]>lim, break); m=0; while(m++<=#u && (t=u[m]^u[r])<=lim, v[t]=0)); u=List(); for(i=2, #v, if(v[i], listput(u, i))); Vec(u) \\ Charles R Greathouse IV, Aug 18 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Anders Hellström, Jun 27 2015
STATUS
approved