Colorfields

64 views
Skip to first unread message

Claudio Meller

unread,
Jul 23, 2026, 11:56:47 AM (13 days ago) Jul 23
to SeqFan
Hello everyone.
On the New Enigma page (https://www.newenigma.com) they published the following problem:

Colorfields by Keith Austin:

Draw a 4-by-4 grid. Color each square red or blue. Select any square, S, and write 1 in it. Then write 1 in every square you can reach from S by a series of moves, where each move is from a square to an adjacent, horizontally, vertically, or diagonally, square of the same color.

Select any empty square, T, and write 2 in it. Then write 2 in every square you can reach from T by a series of moves. Repeat this procedure for 3 and then 4 and so on until every square has a number. The last number you write down is called the “score” for that coloring. If we imagine the grid is the map of a farm, then you have divided the map into fields, one field for each number.

(1) What is the largest score possible?

(2) If we work with a 5x5 grid, what is the largest possible score?

I thought of solutions for 1, 2x2, 3x3, 4x4, etc., which would give a sequence:

1, 2, 5, 6,...

Arthur O'Dwyer

unread,
Jul 23, 2026, 12:24:13 PM (13 days ago) Jul 23
to seq...@googlegroups.com
On Thu, Jul 23, 2026 at 11:56 AM Claudio Meller <claudi...@gmail.com> wrote:
Hello everyone.
On the New Enigma page (https://www.newenigma.com) they published the following problem:

Direct link (but requires an account, which I don't have, in order to view the original wording):
 
Draw a 4-by-4 grid. Color each square red or blue. Select any square, S, and write 1 in it. Then write 1 in every square you can reach from S by a series of moves, where each move is from a square to an adjacent, horizontally, vertically, or diagonally, square of the same color.
Select any empty square, T, and write 2 in it. Then write 2 in every square you can reach from T by a series of moves. Repeat this procedure for 3 and then 4 and so on until every square has a number. The last number you write down is called the “score” for that coloring. If we imagine the grid is the map of a farm, then you have divided the map into fields, one field for each number.
(1) What is the largest score possible?

If we weren't allowed to move diagonally, the high score would obviously be achieved by checkerboard-coloring: then we'd have $n^2$ fields, each of size 1, and the high score would be $n^2$.
Since fields are connected diagonally, the high score is (I'm 99% sure) achieved by making a lattice of $\ceil{n/2}^2$ size-1 fields, necessarily separated by "fences" of the final color:

1    12    152    1525    1A2A3
     22    555    5555    AAAAA
           354    3545    4A5A6
                  5555    AAAAA
                          7A8A9

and so on. The number of fields is $\ceil{n/2}^2 + 1$.

I thought of solutions for 1, 2x2, 3x3, 4x4, etc., which would give a sequence:
1, 2, 5, 6,...

If you can get 6 fields for the 4x4 case, you've found something I didn't.

–Arthur

Geoffrey Caveney

unread,
Jul 23, 2026, 12:27:48 PM (13 days ago) Jul 23
to seq...@googlegroups.com
1525
5555
3544
5546


--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CADvuK0%2BZ-p7rX3VoniT6zNjkLRAh-a%3DU4NjGzkFGhC%2BB2iAgSw%40mail.gmail.com.

Arthur O'Dwyer

unread,
Jul 23, 2026, 12:27:48 PM (13 days ago) Jul 23
to seq...@googlegroups.com
Well, hitting "Send" worked for me. ;) You can indeed get 6:

1525
5555
3544
5546

So I dunno. :)
–Arthur

Arthur O'Dwyer

unread,
Jul 24, 2026, 5:57:14 PM (12 days ago) Jul 24
to seq...@googlegroups.com
On Thu, Jul 23, 2026 at 12:27 PM Arthur O'Dwyer <arthur....@gmail.com> wrote:
On Thu, Jul 23, 2026 at 12:23 PM Arthur O'Dwyer <arthur....@gmail.com> wrote:
On Thu, Jul 23, 2026 at 11:56 AM Claudio Meller <claudi...@gmail.com> wrote:
Hello everyone.
On the New Enigma page (https://www.newenigma.com) they published the following problem:

Direct link (but requires an account, which I don't have, in order to view the original wording):
 
Draw a 4-by-4 grid. Color each square red or blue. Select any square, S, and write 1 in it. Then write 1 in every square you can reach from S by a series of moves, where each move is from a square to an adjacent, horizontally, vertically, or diagonally, square of the same color.
Select any empty square, T, and write 2 in it. Then write 2 in every square you can reach from T by a series of moves. Repeat this procedure for 3 and then 4 and so on until every square has a number. The last number you write down is called the “score” for that coloring. If we imagine the grid is the map of a farm, then you have divided the map into fields, one field for each number.
(1) What is the largest score possible?
[...]
I thought of solutions for 1, 2x2, 3x3, 4x4, etc., which would give a sequence:
1, 2, 5, 6,...

If you can get 6 fields for the 4x4 case, you've found something I didn't.

Well, hitting "Send" worked for me. ;) You can indeed get 6:

1525
5555
3544
5546

Easy brute-force computer search gives the first few terms of the sequence as
1, 2, 5, 6, 10, (>=11), (>=17), (>=18),...
 
For n=5 the best possible is the "obvious" one: $\ceil{n/2}^2 + 1 = 10$.
1A2A3
AAAAA
4A5A6
AAAAA
7A8A9

For n=6 the best possible seems to be the "obvious once you know the n=4 trick" one: $\ceil{n/2}^2 + 1 + (1 if n>2 even) = 11$.
1B2B3B
BBBBBB
4B5B6B
BBBBBB
7B8B99
BBBB9A

For n=7 the "obvious" one gives 17; for n=8 the "obvious" one gives 18; and so on.

I suspect there are no more tricks after the n=4 one, and the sequence is just $a(n) = \ceil{n/2}^2 + 1 + (1 if n>2 even)$.

–Arthur

Christian Sievers

unread,
Jul 25, 2026, 12:23:30 PM (11 days ago) Jul 25
to SeqFan
Hello!

For n=6 I get 12 as optimum, achieved by:
123245
222244
627222
222288
992222
A92B2C

For n=8 I get 19 as optimum:
12223245
22622244
72222222
228292A2
B2222222
222C2D2E
FF222222
GF2H2I2J

There are no other improvements up to n=9.

clingo program:
-------------------------
node(((1..n),(1..n))).
edge((X1,Y1),(X2,Y2)) :- node((X1,Y1)), node((X2,Y2)),
                         DX=|X2-X1|, DY=|Y2-Y1|, DX=0..1, DY=0..1, DX+DY>0.

{ color( P, (r;b) ) } = 1 :- node(P).

rel(P,P) :- node(P).
rel(P,Q) :- rel(Q,P).
rel(P,Q) :- rel(P,X), rel(X,Q).
rel(P,Q) :- edge(P,Q), color(P,C), color(Q,C).

rep(P) :- node(P), P<=Q : rel(P,Q).

#maximize{ 1,P : rep(P) }.

#show color/2.
-------------------------

Call like this: clingo <filename> -c n=<n>
and optionally add "-t<num_threads>".
(I also used a terrible python script to get the alphanumeric display.)


Best
Christian

Arthur O'Dwyer

unread,
4:08 PM (2 hours ago) 4:08 PM
to seq...@googlegroups.com
On Sat, Jul 25, 2026 at 12:23 PM Christian Sievers <g...@duvers.de> wrote:

For n=6 I get 12 as optimum [...]
For n=8 I get 19 as optimum [...]
There are no other improvements up to n=9.
 
Okay, having drawn out those solutions and jiggled them around until they fall into a regular pattern, I claim that now this is all the tricks, and the formula from here on up is "obvious."
https://quuxplusone.github.io/blog/2026/08/05/colourfields/
Anyone want to prove me wrong about that? ;)

Cheers,
Arthur
Reply all
Reply to author
Forward
0 new messages