What is the largest possible number of distinct gcds in a 3x3 grid?

84 Views Asked by At

Consider the following table: \begin{array}{r|cc} \gcd & 20 & 21 & 22 \\ \hline 54 & 2 & 3 & 2 \\ 55 & 5 & 1 & 11 \\ 56 & 4 & 7 & 2 \end{array} This is $\gcd(x,y)$ for $x\in\{20\mathbin{..}22\}$ and $y\in\{54\mathbin{..}56\}$. Note that there are seven different $\gcd$ values: $1$, $2$, $3$, $4$, $5$, $7$, and $11$. My question is: can we go above seven? In other words:

What is the largest possible number of distinct values of $\gcd(x,y)$ for $x\in\{a\mathbin{..}a+2\}$ and $y\in\{b\mathbin{..}b+2\}$, for some pair of positive integers $a$ and $b$?

So far I haven't been able to go above seven, but I suspect we can go all the way up to nine.

(We can easily generalize this question for grid sizes other than $3\times3$.)