Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

A five-digit number $N$ is equal to $45$ times the product of its $5$ digits. Find $N$.

Please help. I am not sure how to solve this. I have a feeling it is simple

share|improve this question

3 Answers 3

up vote 7 down vote accepted

Let the digits of $n$ from left to right be $a,b,c,d$, and $e$, so that we’re told that

$$10^4a+10^3b+10^2c+10d+e=45abcde\;.\tag{1}$$

Clearly $n$ is a multiple of $5$, so $e$ is either $0$ or $5$. But obviously none of the digits is $0$, so $e=5$, and $(1)$ becomes

$$10^4a+10^3b+10^2c+10d+5=225abcd$$

or, after dividing through by $5$,

$$2\left(10^3a+10^2b+10c+d\right)+1=45abcd\;.\tag{2}$$

The lefthand side of $(2)$ is odd, so all of $a,b,c$, and $d$ must be odd as well. The one’s digit of $$2\left(10^3a+10^2b+10c+d\right)+1$$ is either $2d+1$ or $2d+1-10=2d-9$, depending on whether $d<5$ or not. However, the number in $(2)$ is an odd multiple of $5$, so its one’s digit is $5$, and either $2d+1=5$ or $2d-9=5$. Since $d$ is known to be odd, the former is impossible, $d=7$, and $(2)$ becomes

$$20\left(10^2a+10b+c\right)+15=315abc$$

or, after another division by $5$,

$$4\left(10^2a+10b+c\right)+3=63abc\;.\tag{3}$$

Reduce $(3)$ modulo $9$ to see that $$4\left(10^2a+10b+c\right)\equiv 6\pmod 9$$ and hence $10^2a+10b+c\equiv6\pmod9$, which further implies that $a+b+c\equiv6\pmod9$. We know that $a,b$, and $c$ are odd, so $a+b+c$ is odd, and therefore $a+b+c$ can only be $15$; the next larger possibility is $33$, which is too large, since $a+b+c\le3\cdot9=27$. The largest of $a,b$, and $c$ must therefore be at least $5$.

Now note that $100,000>n=45abcde=1575abc$, so $$abc\le\left\lfloor\frac{100,000}{1575}\right\rfloor=63\;.$$ This reduces the possibilities for $a,b$, and $c$ to $7,7,1$ (in some order) and $9,5,1$ (in some order). In the first case we have $45abcde=77175$, so $77175$ is a solution. In the second case we have $45abcde=70875$ and get no solution. The unique solution is therefore $n=77175$.

share|improve this answer

What's wrong with just computing it? Here's some GAP code that would give you the answer:

DecimalDigits:=function(n)
  if(n=0) then return []; fi;
  return Concatenation(DecimalDigits(Int(n/10)),[n mod 10]);
end;;

for n in [10000..99999] do if(45*Product(DecimalDigits(n))=n) then Print(n,"\n"); fi; od;

Here's the answer (spoiler alert):

77175

share|improve this answer
1  
To answer the opening question, using brute force when it’s not necessary is less than elegant. –  Brian M. Scott Dec 4 '12 at 7:50

Note that $abcde=10000a+1000b+100c+10d+e$. Then $10000a+1000b+100c+10d+e=45a*b*c*d*e$. Restrict $\{a,b,c,d,e\}\subset \mathbb{N}$.

share|improve this answer
    
Why was this voted down? –  Jebruho Dec 4 '12 at 6:03
    
I don't know if it was voted down, but if it was the vote has been undone. –  Jonas Meyer Dec 4 '12 at 6:07
2  
Some additional remarks: The restriction should be $\{a,b,c,d,e\}\subset\{0,1,2,3,4,5,6,7,8,9\}$, not just $\mathbb N$. Because the number is a multiple of $5$, $e$ must be $0$ or $5$, but it cannot be $0$, so $e=5$. Thus the number is odd, which implies that $a,b,c,d$ are also odd, and the number is a multiple of $25$, so $d=7$... –  Jonas Meyer Dec 4 '12 at 6:12
    
@JonasMeyer - The set of values should not include $0$ for any of the five digits, since a zero in any position would make the product $0$, which is not a "5-digit number." –  Jeffrey L Whitledge Dec 4 '12 at 6:46
    
@Jeffrey: That's right. I used that to conclude that $e$ is not $0$ in my comment. Subsequently it follows (from $e=5$) that not only are the other numbers not $0$, but they can't be even because the product is odd. –  Jonas Meyer Dec 4 '12 at 6:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.