login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359333
a(1) = 0, and for any n > 1, a(n) is chosen among 0 and 1 so as to minimize the length of the longest sequence of distinct integers in arithmetic progression in the interval 1..n and containing n where the sequence is constant; in case of a tie, maximize the least common difference in those longest arithmetic progressions.
1
0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1
OFFSET
1
COMMENTS
This sequence has connections with A038219; in both sequences we try to avoid certain patterns when computing successive terms.
EXAMPLE
For n = 1:
- a(1) = 0 by definition.
For n = 2:
- the value 0 would imply an arithmetic progression of length 2,
- the value 1 would imply an arithmetic progression of length 1,
- so a(2) = 1.
For n = 3:
- the value 0 would imply an arithmetic progression of length 2 and common difference 2,
- the value 1 would imply an arithmetic progression of length 2 and common difference 1,
- so a(3) = 0.
PROG
(C) See Links section.
CROSSREFS
Cf. A038219.
Sequence in context: A165211 A341389 A188027 * A193496 A284533 A286665
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jan 23 2023
STATUS
approved