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.

A020655 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 5.

This page as a plain text file.
%I A020655 #19 Jan 04 2016 17:38:01
%S A020655 1,2,3,4,6,7,8,9,11,12,13,14,16,17,18,19,26,27,28,29,31,32,33,34,36,
%T A020655 37,38,39,41,42,43,44,51,52,53,54,56,57,58,59,61,62,63,64,66,67,68,69,
%U A020655 76,77,78,79,81,82,83,84,86,87,88,89,91,92,93,94,126,127,128,129,131,132,133
%N A020655 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 5.
%H A020655 Robert Israel, <a href="/A020655/b020655.txt">Table of n, a(n) for n = 1..10000</a>
%p A020655 Noap:= proc(N,m)
%p A020655 # N terms of earliest increasing seq with no m-term arithmetic progression
%p A020655 local A,forbid,n,c,ds,j;
%p A020655 A:= Vector(N):
%p A020655 A[1..m-1]:= <($1..m-1)>:
%p A020655 forbid:= {m}:
%p A020655 for n from m to N do
%p A020655   c:= min({$A[n-1]+1..max(max(forbid)+1, A[n-1]+1)} minus forbid);
%p A020655   A[n]:= c;
%p A020655   ds:= convert(map(t -> c-t, A[m-2..n-1]),set);
%p A020655   for j from m-2 to 2 by -1 do
%p A020655     ds:= ds intersect convert(map(t -> (c-t)/j, A[m-j-1..n-j]),set);
%p A020655     if ds = {} then break fi;
%p A020655   od;
%p A020655   forbid:= select(`>`,forbid,c) union map(`+`,ds,c);
%p A020655 od:
%p A020655 convert(A,list)
%p A020655 end proc:
%p A020655 Noap(100, 5); # _Robert Israel_, Jan 04 2016
%t A020655 t = {1, 2, 3, 4}; Do[s = Table[Append[i, n], {i, Subsets[t, {4}]}]; If[! MemberQ[Table[Differences[i, 2], {i, s}], {0, 0, 0}], AppendTo[t, n]], {n, 5, 100}]; t (* _T. D. Noe_, Apr 17 2014 *)
%Y A020655 Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
%Y A020655 3-term AP: A005836 (>=0), A003278 (>0);
%Y A020655 4-term AP: A005839 (>=0), A005837 (>0);
%Y A020655 5-term AP: A020654 (>=0), A020655 (>0);
%Y A020655 6-term AP: A020656 (>=0), A005838 (>0);
%Y A020655 7-term AP: A020657 (>=0), A020658 (>0);
%Y A020655 8-term AP: A020659 (>=0), A020660 (>0);
%Y A020655 9-term AP: A020661 (>=0), A020662 (>0);
%Y A020655 10-term AP: A020663 (>=0), A020664 (>0).
%K A020655 nonn
%O A020655 1,2
%A A020655 _David W. Wilson_