# The number of all 3-digit numbers abc for which abc + ab+bc + ac+a+b+c = 29

The number of all 3-digit numbers abc (in base 10) for which $\ abc+ab+bc+ac+a+b+c = 29$ is
(A) 6
(B) 10
(C) 14
(D) 18

My working:
$\ ab (c + 1) +b (c + 1) + a(c + 1) + c + 1 = 30$
$\ (a + 1) (b +1) (c+1) = 30$
$\ 9>a>0$
$\ 0\le b,c<9$

The problem I am facing:
I don't know how to figure out the no. of solutions for which this is true.

• The title is a bit confusing as it contains "abc" in two different meanings. – JiK Aug 8 '16 at 18:08
• @JiK. The title and the Q are also misleading as none of the solutions include what are usually called "3-digit numbers in base ten". – DanielWainfleet Aug 8 '16 at 19:19
• @user254665, both title and question are asking how many 3-digit numbers have a specified, rather constraining, property, so it makes sense that the answer is less than $100$ (as the posted solutions show to be the case). – Barry Cipra Aug 9 '16 at 0:42

$$(a+1)(b+1)(c+1)=30$$

Total number of ways to satisfy above equation:

1. $30 = (2,3,5)$ gives $6$ values for $a+1,b+1,c+1$ $(i.e., a=1, b=2, c=4)$
2. $30 = ( 1 , 6 ,5)$ gives $6$ values for $a+1,b+1,c+1$ $(i.e., a=0, b=5, c=4)$
3. $30 = (1,3,10)$ gives $6$ values for $a+1,b+1,c+1$ $(i.e., a=0, b=2, c=9)$

In the first case we have $6$ values for $a,b,c$ as $(1,2,4)$ can take up any digit hence they can be arranged in $3!$ ways.

In the second case we have $4$ values for $a,b,c$ as $(0,5,4)$. $0$ can not be as first digit as. Then $abc$ would be a $2$ digit number ( contrary to given condition ). Hence we have $2.2.1$ number of ways .

Similarly in the third case we have $4$ values $a,b,c$ as $(0,2,9)$. $0$ can not be as first digit as. Then $abc$ would be a $2$ digit number ( contrary to given condition ). Hence we have $2.2.1$ number of ways .

Therefore, total number of ways:

$$3!+2\times 2\times1+2\times 2\times1=6+4+4=14 \space \text{ways}$$

• Perhaps you could combine this with Jennifer's answer to justify why these are the only possibilities. – Morgan Rogers Aug 8 '16 at 15:23

The prime fctorisation of $30$ is $5\times3\times2$. The only ordered 3-uples for $a+1,b+1$ and $c+1$ where $a+1 \in [2,10]$ and $b+1,c+1 \in [1,10]$ are : $$(2,3,5),(2,5,3),(3,1,10),(3,2,5),(3,5,2),(3,10,1),(5,1,6),(5,2,3),(5,3,2),(5,6,1),(6,1,5),(6,5,1),(10,1,3),(10,3,1)$$

So the solutions are : $$124,142,209,214,241,290,405,412,421,450,504,540,902,920$$

• Second last number should be 902 instead of 903. – Tejas Kale Aug 8 '16 at 18:34

A quick bruteforce approach to figuring out the possible number of solutions:

Javascript code, paste in browser console for a quick test.

for(i=100;i<=999;i++){
a=i.toString();
//Take the individual characters(the digits) of the string, increment by 1 and multiply.
if(++a[0]*++a[1]*++a[2] === 30){
console.log(i);
}
}


This gives the following 14 numbers:
124 142 209 214 241 290 405 412 421 450 504 540 902 920

Another brute-force approach, using Python:

[100*a+10*b+c for a in range(1,10) for b in range(10) for c in range(10)\ if a*b*c+a*b+b*c+a*c+a+b+c == 29]

yields[124, 142, 209, 214, 241, 290, 405, 412, 421, 450, 504, 540, 902, 920]