For example with n=6 the sequence rbrbrb does not work because 1,3,5 are all red and 2,4,6 are all blue. Whereas rbrbbr does work.

What is the largest value of n for which such a sequence exists?

Note: Since the colors can be swapped, make the number 1 red.

Add a third color (green.) What is the new maximum value of n?

Instead of a third color, add a fourth term (d) so that a, b, c, and d cannot all be the same color if they are in an arithmetic sequence.