# 5x5 Grid with all two digit numbers

There is a $5\times5$ grid where you are supposed to put all two digit numbers which consist only of the digits $1$ to $5$, namely $11,12,13,14,15$,$21,22$,....

The task is to put all these two digit numbers into the grid such that horizontally or vertically there has to be at most two of each digit.

Is it possible? If not, what is the maximum amount of distinct two-digit numbers you can put?

Suppose we:

Swapped the tens digits 1, 2, 3, 4, 5 for A, B, C, D, E

Make two latin squares such that when placed on top of each other each ordered pair of values appears only once (as @JaapScherphius points out, this is called a Graeco-Latin square)

And we can do this:

A1 B2 C3 D4 E5
B5 C1 D2 E3 A4
C4 D5 E1 A2 B3
D3 E4 A5 B1 C2
E2 A3 B4 C5 D1

Converting back, we have:

11 22 33 44 55
25 31 42 53 14
34 45 51 12 23
43 54 15 21 32
52 13 24 35 41

NB:

A 6x6 grid wouldn't be possible via this particular method, neither would a 2x2 grid, but everything else would be

• is this question something asked before? I thought it was my original to be honest :))) you solved it too fast. – Oray Oct 28 '17 at 8:57
• @Oray I haven't heard of a similar question, but my experiences in mathematics have taught me to try simplifying the problem, which worked in this case. – boboquack Oct 28 '17 at 9:00
• does it related to 5x5 magic square? – Saurabh Prajapati Oct 28 '17 at 9:01
• @SaurabhPrajapati nope, not even close. – Oray Oct 28 '17 at 9:09
• en.wikipedia.org/wiki/Graeco-Latin_square – Jaap Scherphuis Oct 28 '17 at 9:19