## Unique Pairs and a Domino Square

1. How many different digits are needed to fill an NxN grid, such that every pair of adjacent digits (horizontally and vertically) is a unique pair? Solve for N=2,3,4,5,6. Give examples. For example, for N=2, three digits are needed:
 ```00 12``` This 2x2 grid has the four unique pairs 00, 01, 02, and 12.
2. How many different digits are needed to fill an NxN grid, such that no pair of digits can be found adjacent in the grid more than twice? Solve for N=2,3,4,5,6.
3. How many different digits are needed to fill an NxN grid, such that no pair of digits can be found adjacent in the grid more than three times? Solve for N=2,3,4,5,6. My extended question for this is, Can a set of double-5 dominoes (minus 3 dominoes) fill a 6x6 grid such that no pair of digits can be found adjacent more than three times?

Source: Original.

UPDATE July 8, 1999: Wilfred Theunissen sent a solution to the final question (see the last answer below.) Solutions for all the other questions were received from Alexander Doskey:
```An NxN board will require N*(N-1)*2 adjacencies

D digits will produce Sum(1 to D) combinations
0- 0:1=1 combinations {00}
0- 1:1+2=3 combinations {00,01,11}
0- 2:1+2+3=6 combinations {00,01,02,11,12,22}
0- 3:1+2+3+4=10 combinations {etc.}
0- 4:1+2+3+4+5=15 combinations
0- 5:1+2+3+4+5+6=21 combinations
0- 6:1+2+3+4+5+6+7=28 combinations
0- 7:1+2+3+4+5+6+7+8=36 combinations
0- 8:1+2+3+4+5+6+7+8+9=45 combinations
0- 9:1+2+3+4+5+6+7+8+9+10=55 combinations
0-10:1+2+3+4+5+6+7+8+9+10+11=66 combinations

1. Limited to one occurrence of each adjacency.
N=2, D=3, A=4:{00,01,02,12}
00
12

N=3, D=5, A=12:{01,02,03,04,11,12,13,22,24,33,34,44}
113
203
244

N=4, D=7,
A=24:{00,01,02,03,04,05,06,12,13,14,15,16,23,24,25,26,34,35,36,44,45,46,55,5
6}
4455
3006
5123
2461

N=5, D=10,
A=40:{00,01,02,03,04,05,06,11,12,13,14,15,16,17,18,19,22,23,24,29,

33,34,35,36,39,45,46,48,49,55,56,57,58,66,67,68,69,78,89,99}
42339
92046
91055
81671
53684

N=6, D=12, A=60:{00,01,02,03,04,05,06,07,08,11,12,13,14,15,16,17,1a,
22,23,24,25,26,27,28,2a,33,34,35,36,37,38,39,
44,45,46,47,4a,4b,55,56,57,58,5a,5b,66,67,69,6a,
77,78,79,7a,7b,88,89,8a,99,aa,ab,bb
(where a=10 and b=11)

17bbaa
a55447
660033
411228
253678
a89970

2. Limited to two occurrences of each adjacency.
N=2, D=2, A=4/2:{00,01,01,11}
00
11

N=3, D=3, A=12/2:{can't be done}
N=3, D=4, A=12/2:{00,00,01,01,02,11,12,12,13,23,23,33}
000
112
233

N=4, D=5, A=24/2:{00,00,01,01,02,02,03,03,04,04,11,12,
13,14,14,23,24,24,33,33,34,34,44,44}
3112
4003
4203
1443

N=5, D=6,  A=40/2:{00,00,01,01,02,02,03,03,04,04,05,05,
11,11,12,12,13,14,14,15,15,22,22,23,
23,24,25,25,33,33,34,34,35,35,44,44,
45,45,55,55}
44553
10003
11432
22435
02515

N=6, D=8, A=60/2:{00,00,01,01,02,02,03,03,04,04,05,05,06,06,07,
11,11,12,13,13,14,14,15,15,16,17,22,22,23,25,
26,26,27,33,33,34,34,35,35,36,36,37,44,44,45,
45,46,46,47,47,55,55,56,56,66,66,67,67,77,77}
655566
111226
400027
453337
431460
067745

3. Limited to three occurrences of each adjacency.
N=2, D=2, A=4/3:{00,01,01,11}
00
11

N=3, D=3, A=12/3:{00,00,01,01,01,11,11,12,12,12,22,22}
000
111
222

N=4, D=4, A=24/3:{00,00,00,01,01,01,02,02,03,11,11,12,
12,12,13,13,13,22,23,23,23,33,33,33}
0000
1112
2233
0331

N=5, D=5, A=40/3:{00,00,00,01,01,01,02,02,02,03,03,03,04,04,
11,11,11,12,12,12,13,13,13,14,14,22,22,23,
23,23,24,24,24,33,33,33,34,44,44,44
00001
22211
33312
01444
33042

N=6, D=6, A=60/3:{did not find any yet}
```

July 8, 1999: Here is Wilfred Theunissen's domino square which solves the final question. The missing dominos are 12, 33, and 45. All digit pairs are represented three times, except twice for the pairs 04, 15, and 33.
``` _ _ ___ _ _
|0|0|0 0|1|0|
|1|2|2 2|1|3|
|1|1 3|2 3|0|
|4|4 3|4|3|5|
|1|5 5|0|5|5|
|5|2 4|4 4|2|
```

Mail to Ken