cp's OEIS Frontend

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.

A259444 a(1)=2. For n>1, a(n) = smallest number > a(n-1) which is different from all the numbers a(i)^a(j) for 1 <= i < n, 1 <= j < n.

Original entry on oeis.org

2, 3, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Anders Hellström, Jun 27 2015

Keywords

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

Examples

			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).
		

Crossrefs

Cf. A007916, A259183 (complement).
Equivalent lexicographically earliest sequences for other operations: A000069 (binary exclusive OR), A005408 (addition), A026424 (multiplication).

Programs

  • 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

Formula

a(n) = n + sqrt(n) + O(n^(1/3)). - Charles R Greathouse IV, Aug 18 2015