login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Greedy strictly increasing sequence starting at a(1)=1 avoiding both arithmetic and geometric progressions of length 3.
1

%I #39 Jul 03 2017 09:14:23

%S 1,2,5,6,12,13,15,16,32,33,35,39,40,42,56,81,84,85,88,90,93,94,108,

%T 109,113,115,116,159,189,207,208,222,223,232,235,240,243,244,249,250,

%U 252,259,267,271,289,304,314,318,325,340,342,397,504,508,511,531,549

%N Greedy strictly increasing sequence starting at a(1)=1 avoiding both arithmetic and geometric progressions of length 3.

%C By avoiding arithmetic progressions, at most 2/3 of the numbers up to a(n) are in the sequence. The sequence doesn't contain 3 consecutive powers in arithmetic progression for any base c.

%C Where a(n)+1 = a(n+1): 1, 3, 5, 7, 9, 12, 17, 21, 23, 26, 30, 32, 37, 39, etc. - _Robert G. Wilson v_, Jul 02 2017

%H Alois P. Heinz, <a href="/A289206/b289206.txt">Table of n, a(n) for n = 1..10000</a>

%H Math StackExchange, <a href="https://math.stackexchange.com/questions/858918/a-sequence-that-avoids-both-arithmetic-and-geometric-progressions">A sequence that avoids both arithmetic and geometric progression</a> (2014)

%F a(n) >= 3n/2 for n > 2.

%e 5 is in the sequence because 1,2,5 is neither an arithmetic progression nor a geometric progression.

%o (PARI) {my(a=[1,2]);

%o for(x=3,100,

%o if(#select(r->#select(q->q==2*r,b)==0,b=vecsort(apply(r->x-r,a)))==#a && #select(r->#select(q->q==r^2,b)==0,b=vecsort(apply(r->x/r,a)))==#a,a=concat(a,x)));a

%o }

%o (PARI) first(n)=my(v=vector(n)); v[1]=1; for(k=2,n, my(avoid=List(),t,last=v[k-1]); for(i=2,k-1, for(j=1,i-1, t=2*v[i]-v[j]; if(t>last, listput(avoid, t)); if(denominator(t=v[i]^2/v[j])==1 && t>last, listput(avoid,t)))); avoid=Set(avoid); for(i=v[k-1]+1,v[k-1]+#avoid+1, if(!setsearch(avoid,i), v[k]=i; break))); v \\ _Charles R Greathouse IV_, Jun 29 2017

%Y Cf. A000452, A003278, A005836, A224853, A225571.

%K nonn

%O 1,2

%A _Roderick MacPhee_, Jun 28 2017

%E More terms from _Alois P. Heinz_, Jun 28 2017