login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A020662 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 9. 28

%I #14 Jan 04 2016 20:28:38

%S 1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,19,20,21,22,23,24,27,28,29,

%T 30,31,32,33,34,37,38,39,40,41,43,44,45,46,47,48,49,50,53,55,56,57,58,

%U 59,60,64,65,66,67,68,69,70,71,78,79,80,81,82,83,84,85,87,88,91,92,94,95,96,97

%N Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 9.

%H Robert Israel, <a href="/A020662/b020662.txt">Table of n, a(n) for n = 1..10000</a>

%p Noap:= proc(N,m)

%p # N terms of earliest increasing seq with no m-term arithmetic progression

%p local A,forbid,n,c,ds,j;

%p A:= Vector(N):

%p A[1..m-1]:= <($1..m-1)>:

%p forbid:= {m}:

%p for n from m to N do

%p c:= min({$A[n-1]+1..max(max(forbid)+1, A[n-1]+1)} minus forbid);

%p A[n]:= c;

%p ds:= convert(map(t -> c-t, A[m-2..n-1]),set);

%p for j from m-2 to 2 by -1 do

%p ds:= ds intersect convert(map(t -> (c-t)/j, A[m-j-1..n-j]),set);

%p if ds = {} then break fi;

%p od;

%p forbid:= select(`>`,forbid,c) union map(`+`,ds,c);

%p od:

%p convert(A,list)

%p end proc:

%p Noap(100,9); # _Robert Israel_, Jan 04 2016

%Y Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):

%Y 3-term AP: A005836 (>=0), A003278 (>0);

%Y 4-term AP: A005839 (>=0), A005837 (>0);

%Y 5-term AP: A020654 (>=0), A020655 (>0);

%Y 6-term AP: A020656 (>=0), A005838 (>0);

%Y 7-term AP: A020657 (>=0), A020658 (>0);

%Y 8-term AP: A020659 (>=0), A020660 (>0);

%Y 9-term AP: A020661 (>=0), A020662 (>0);

%Y 10-term AP: A020663 (>=0), A020664 (>0).

%K nonn

%O 1,2

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 09:20 EDT 2024. Contains 371769 sequences. (Running on oeis4.)