Find the largest possible number n of three-digit numbers, following a set of properties

contest-mathdiscrete optimizationinequalitynumber theory

I just recently solved the following problem

Let n three-digit numbers satisfy the following properties:

(1) No number contains the digit 0.

(2) The sum of the digits of each number is 9

(3) The units digits of any two numbers are different.

(4) The tens digits of any two numbers are different.

(5) The hundreds digits of any two numbers are different.

Find the largest possible value of n.

I solved it in the following way:

I state that ai, bi, ci are the hundreds, tens and ones digits of the ith number respectively.

Since $ai, bi, ci\neq 0$ we have that $7\ge ai, bi, ci\ge 1$ for all $ai, bi, ci\in N$ and $ai, bi, ci \in [1, 7]$ (since from (2) we have that the addition of $ai+bi+ci=9$)

If $n=7$

Then $\sum\limits_{i=1}^7ai+bi+ci=63$, however $\sum\limits_{i=1}^7ai+bi+ci=3(1+…+7)=84$ (which is the addition of the digits, from property (2)), which is false.

Since $ai, bi, ci\in[1, 7]$, then if n=6 $\sum\limits_{i=1}^6 3(ai+bi+ci)\ge84-3*7=63$, however, once again $\sum\limits_{i=1}^6 ai+bi+ci=54$, so impossible. So maxn=5 for the set of {135, 243, 351, 414, 522}.

Once I wrote this out, I was wondering if there exists a simpler method of solving it. Could you please show me some alternative methods?

Best Answer

As you notice $ n \leq 7$. Now, let's assume we can take full advantage of n, meaning that all numbers from $1$ to $n$ appear in every position. Summing the numbers gives $9n$ as you said but also $3$ times the sum of natural numbers up to $n$. Therefore,

$ 3 \frac{n(n+1)}{2} = 9n \implies n = 5$

The set you gave as answer satisfies this property. Finally, since both $n = 6$ and $n = 7$ cannot be fully used, they can give a set of size at most $n - 1$. So we only have to check if we can have a set of size 6 with it's largest number being 7. 7 can only appear in $7 + 1 + 1$ using both 1's so 6 cannot appear. 5 can now only appear as $5 + 2 + 2$ using both 2's so 4 cannot appear. And we are done!

Related Question