OFFSET
1,2
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
J. L. Gerver and L. T. Ramsey, Sets of integers with no long arithmetic progressions generated by the greedy algorithm, Math. Comp. 33 (1979), 1353-1359.
FORMULA
a(n) = A020656(n) + 1.
MAPLE
N:= 100: # to get a(1)..a(N)
A:= Vector(N):
A[1..5]:= <($1..5)>:
forbid:= {6}:
for n from 6 to N do
c:= min({$A[n-1]+1::max(max(forbid)+1, A[n-1]+1)} minus forbid);
A[n]:= c;
ds:= convert(map(t -> c-t, A[4..n-1], set);
if ds = {} then next fi;
ds:= ds intersect convert(map(t -> (c-t)/4, A[1..n-4]), set);
if ds = {} then next fi;
ds:= ds intersect convert(map(t -> (c-t)/3, A[2..n-3]), set);
if ds = {} then next fi;
ds:= ds intersect convert(map(t -> (c-t)/2, A[3..n-2]), set);
forbid:= select(`>`, forbid, c) union map(`+`, ds, c);
od:
convert(A, list); # Robert Israel, Jan 04 2016
PROG
(PARI) A005838(n, show=1, i=1, o=6, u=0)={for(n=1, n, show&&print1(i, ", "); u+=1<<i; while(i++, for(s=1, (i-1)\(o-1), for(j=1, o-1, bittest(u, i-s*j)||next(2)); next(2)); next(2))); i} \\ M. F. Hasler, Jan 03 2016
CROSSREFS
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name and links/references edited by M. F. Hasler, Jan 03 2016
Further edited by N. J. A. Sloane, Jan 04 2016
STATUS
approved