A248625 Lexicographically earliest sequence of nonnegative integers such that no triple (a(n),a(n+d),a(n+2d)) is in arithmetic progression, for any d>0, n>=0.
0, 0, 1, 0, 0, 1, 1, 3, 3, 0, 0, 1, 0, 0, 1, 1, 3, 3, 1, 3, 3, 4, 4, 7, 4, 4, 8, 0, 0, 1, 0, 0, 1, 1, 3, 3, 0, 0, 1, 0, 0, 1, 1, 3, 3, 1, 3, 3, 4, 4, 7, 4, 4, 8, 8, 3, 3, 4, 4, 9, 4, 4, 9, 1, 9, 12, 10, 9, 7, 10, 12, 9, 11, 9, 9, 11, 9, 10, 13, 19, 12, 0, 0, 1, 0, 0, 1, 1, 3, 3
Offset: 0
Keywords
Examples
Start with a(0)=a(1)=0, smallest possible choice and trivially satisfying the constraint since no 3-term subsequence is possible. Then one must take a(2)=1 since otherwise [0,0,0] would be an AP. Then one can take again a(3)=a(4)=0, and a(5)=1. Now appending 0 would yield the AP (0,0,0) by extracting terms with indices 0,3,6; therefore a(6)=1. Now a(7) cannot be 0 not 1 nor 2 since else a(3)=0, a(5)=1, a(7)=2 would be an AP, therefore a(7)=3 is the least possible choice.
Programs
-
PARI
[DD(v)=vecextract(v,"^1")-vecextract(v,"^-1"), hasAP(a,m=3)=u=vector(m,i,1);v=vector(m,i,i-1);for(i=1,#a-m+1,for(s=1,(#a-i)\(m-1),#Set(DD(t=vecextract(a,(i)*u+s*v)))==1&&return ([i,s,t])))]; a=[]; for(n=1,90,a=concat(a,0);while(hasAP(a),a[#a]++);print1(a[#a]","));a
Formula
a(n) = A229037(n+1)+1.
Comments