OFFSET
0,4
COMMENTS
The sequence A003002 gives the size of the largest subset of the integers up to n that avoids three-term arithmetic progressions. This sequence gives the number of distinct subsets of [1..n] that have that size and are free of three-term arithmetic progressions.
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..140
Fausto A. C. Cariboni, All sets that yield a(n) for n = 4..130., Feb 19 2018.
Janusz Dybizbanski, Sequences containing no 3-term arithmetic progressions, The Electronic Journal of Combinatorics, 19, no. 2 (2012).
EXAMPLE
The largest subset of [1,6] that doesn't have any 3 terms in arithmetic progression has size 4. There are 4 such subsets with this property: {1,2,4,5}, {1,2,5,6}, {1,3,4,6} and {2,3,5,6}, so a(6)=4.
MAPLE
G:= proc(n, cons, t)
option remember;
local consn, consr;
if n < t or member({}, cons) then return {} fi;
if t = 0 then return {{}} fi;
consn, consr:= selectremove(has, cons, n);
consn:= subs(n=NULL, consn);
procname(n-1, consr, t) union
map(`union`, procname(n-1, consr union consn, t-1), {n});
end proc:
F:= proc(n)
local m, cons, R;
m:= A003002(n-1);
cons:= {seq(seq({i, i+j, i+2*j}, i=1..n-2*j), j=1..(n-1)/2)};
R:= G(n, cons, m+1);
if R = {} then
A003002(n):= m;
G(n, cons, m);
else
A003002(n):= m+1;
R
fi
end proc:
A003002(1):= 1:
a[1]:= 1:
for n from 2 to 40 do
a[n]:= nops(F(n))
od:
seq(a[i], i=1..40); # Robert Israel, Sep 20 2015
MATHEMATICA
a[n_] := a[n] = Count[Subsets[Range[n], {A003002[[n+1]]}], s_ /; !MatchQ[s, {___, n1_, ___, n2_, ___, n3_, ___} /; n2 - n1 == n3 - n2]];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 25}] (* Jean-François Alcover, May 30 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Nathan McNew, Sep 18 2015
EXTENSIONS
a(25) to a(44) from Robert Israel, Sep 20 2015
a(45) to a(75) from Fausto A. C. Cariboni, Jan 15 2018
a(0)=1 prepended by Alois P. Heinz, May 16 2020
STATUS
approved