The three-digit number 999 has a special property: It is divisible by 27, and its digit sum is also divisible by 27. The four-digit number 5778 also has this property, as it is divisible by 27 and its digit sum is also divisible by 27. How many four-digit numbers have this property?
Problem
Source: Israel National Olympiad 2018 Q4
Tags: number theory, Digits, digit sum, Divisibility
08.08.2019 07:36
Let $abcd$ be a four-digit number, with $1\le a\le9$ and $0\le b,c,d\le 9$, and $a,b,c,d$ positive integers. Then we need to have $1000a+100b+10c+d=27n$ and $a+b+c+d=27m$, where $n,m$ are positive integers. But $27m\le 4\cdot 9$ and thus $m=1$. Therefore $111a+11b+c=3(n-1)$ which leads to $2b+c$ being a multiple of $3$. We now examine 9 different cases, keeping in mind that $1\le a+d\le 18$: 1) For $b=0$, we have $c=0,3,6,$ or $9$, which leads to $a+d=27,24,21,$ or $18$. Only the last choice is acceptable, which gives us one solution ($9099$). 2) For $b=1$, we have $c=1,4,$ or $7$, which leads to $a+d=25,22,$ or $19$. No choice is acceptable. 3) For $b=2$, we have $c=2,5,$ or $8$, which leads to $a+d=23,20,$ or $17$. Only the last choice is acceptable, which gives us two solutions ($9288$ and $8289$). 4) For $b=3$, we have $c=0,3,6,$ or $9$, which leads to $a+d=24,21,18,$ or $15$. Only the last two choices are acceptable; the former gives us one solution ($9369$) and the latter gives us 4 solutions ($6399,7398,8397$ and $9396$). 5) For $b=4$, we have $c=1,4,$ or $7$, which leads to $a+d=22,19,$ or $16$. Only the last choice is acceptable, which gives us three solutions ($7479,8478,$ and $9477$). 6) For $b=5$, we have $c=2,5,$ or $8$, which leads to $a+d=20,17,$ or $14$. Only the last two choices are acceptable; the former gives us two solutions, and the latter 5 (for a total of seven solutions). 7) For $b=6$, we have $c=0,3,6,$ or $9$, which leads to $a+d=21,18,15,$ or $12$. The last three choices are acceptable and give us $1+4+7=12$ solutions. 8) For $b=7$, we have $c=1,4,$ or $7$, which leads to $a+d=19,16$ or $13$. The last two choices are acceptable and give us $3+6=9$ solutions. 9) For $b=8$, we have $c=2,5,$ or $8$, which leads to $a+d=17,14,$ or $11$. All choices are acceptable and give us $2+5+8=15$ solutions. 10) For $b=9$, we have $c=0,3,6,$ or $9$, which leads to $a+d=18,15,15$ or $9$. All choices are acceptable and give us $1+4+7+9=21$ solutions. Therefore, there are $1+2+5+3+7+12+9+15+21=75$ four-digit numbers with this property.
08.08.2019 07:51
tk1 wrote: Let $abcd$ be a four-digit number, with $1\le a\le9$ and $0\le b,c,d\le 9$, and $a,b,c,d$ positive integers. Then we need to have $1000a+100b+10c+d=27n$ and $a+b+c+d=27m$, where $n,m$ are positive integers. But $27m\le 4\cdot 9$ and thus $m=1$. Therefore $111a+11b+c=3(n-1)$ which leads to $2b+c$ being a multiple of $3$. We now examine 9 different cases, keeping in mind that $1\le a+d\le 18$: 1) For $b=0$, we have $c=0,3,6,$ or $9$, which leads to $a+d=27,24,21,$ or $18$. Only the last choice is acceptable, which gives us one solution ($9099$). 2) For $b=1$, we have $c=1,4,$ or $7$, which leads to $a+d=25,22,$ or $19$. No choice is acceptable. 3) For $b=2$, we have $c=2,5,$ or $8$, which leads to $a+d=23,20,$ or $17$. Only the last choice is acceptable, which gives us two solutions ($9288$ and $8289$). 4) For $b=3$, we have $c=0,3,6,$ or $9$, which leads to $a+d=24,21,18,$ or $15$. Only the last two choices are acceptable; the former gives us one solution ($9369$) and the latter gives us 4 solutions ($6399,7398,8397$ and $9396$). 5) For $b=4$, we have $c=1,4,$ or $7$, which leads to $a+d=22,19,$ or $16$. Only the last choice is acceptable, which gives us three solutions ($7479,8478,$ and $9477$). 6) For $b=5$, we have $c=2,5,$ or $8$, which leads to $a+d=20,17,$ or $14$. Only the last two choices are acceptable; the former gives us two solutions, and the latter 5 (for a total of seven solutions). 7) For $b=6$, we have $c=0,3,6,$ or $9$, which leads to $a+d=21,18,15,$ or $12$. The last three choices are acceptable and give us $1+4+7=12$ solutions. 8) For $b=7$, we have $c=1,4,$ or $7$, which leads to $a+d=19,16$ or $13$. The last two choices are acceptable and give us $3+6=9$ solutions. 9) For $b=8$, we have $c=2,5,$ or $8$, which leads to $a+d=17,14,$ or $11$. All choices are acceptable and give us $2+5+8=15$ solutions. 10) For $b=9$, we have $c=0,3,6,$ or $9$, which leads to $a+d=18,15,15$ or $9$. All choices are acceptable and give us $1+4+7+9=21$ solutions. Therefore, there are $1+2+5+3+7+12+9+15+21=75$ four-digit numbers with this property. Very nice. The valid numbers can be listed as below
Attachments:
