OFFSET
0,3
LINKS
Fausto A. C. Cariboni, Table of n, a(n) for n = 0..80
Eric Weisstein's World of Mathematics, Nonaveraging Sequence
Wikipedia, Arithmetic progression
Wikipedia, Salem-Spencer set
MAPLE
b:= proc(n, s) option remember; `if`(n<1, 1, b(n-1, s)+
`if`(ormap(j-> 2*j-n in s, s), 0, b(n-1, s union {n})))
end:
a:= n-> b(n-1, {n}):
seq(a(n), n=0..23);
MATHEMATICA
b[n_, s_] := b[n, s] = If[n < 1, 1, b[n-1, s] +
If[AnyTrue[s, MemberQ[s, 2 # - n]&], 0, b[n-1, s ~Union~ {n}]]];
a[n_] := b[n-1, {n}];
a /@ Range[0, 23] (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 14 2020
STATUS
approved