Fine with Five?

Logic Level 4

The digits of the positive integer n n include no 9s, exactly four 8s, exactly three 7s, exactly two 6s, and some other digits. If the sum of the digits of n n is 104 and the sum of the digits of 2 n 2n is 100, then how many times the digit 5 occurs in n?


The answer is 3.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Josh Petrin
Dec 28, 2013

Let S ( n ) S(n) denote the digit sum of n n . We can see fairly easily that, given S ( n ) S(n) , S ( 2 n ) S(2n) can be calculated in the following way:

  • 8 2 = 16 8 \cdot 2 = 16 , so for k k 8 8 's in n n , ( 1 + 6 ) k = 7 k (1+6)k = 7k will be added to the digit sum of 2 n 2n .

  • 7 2 = 14 7 \cdot 2 = 14 , so for k k 7 7 's in n n , ( 1 + 4 ) k = 5 k (1+4)k = 5k will be added to the digit sum of 2 n 2n .

  • 6 2 = 12 6 \cdot 2 = 12 , so for k k 6 6 's in n n , 3 k 3k will be added.

  • 5 2 = 10 5 \cdot 2 = 10 , so for k k 5 5 's in n n , k k will be added.

  • For all other digits less than 5 5 , the digit sum will double per digit.

Since we are trying to look for the number of 5 5 's in n n , let the number of 5 5 's be equal to x x , and let the sum of the digits below 5 5 be equal to y y . The problem gives that

S ( n ) = 104 = 4 ( 8 ) + 3 ( 7 ) + 2 ( 6 ) + 5 x + y , S(n) = 104 = 4(8) + 3(7) + 2(6) + 5x + y,

so 5 x + y = 39 5x + y = 39 . We also know, by our double-digit-sum calculator, that

S ( 2 n ) = 100 = 4 ( 7 ) + 3 ( 5 ) + 2 ( 3 ) + x + 2 y , S(2n) = 100 = 4(7) + 3(5) + 2(3) + x + 2y,

so x + 2 y = 51 x + 2y = 51 . Solving for x x , we find that our answer is 3 \boxed{3} .

Daniel Liu
Dec 26, 2013

First, note that it does not specify where the 8 , 7 , 6 8,7,6 's are, so we can assume that they go in the front in the order 888877766 888877766 and hope that it works out later.

We have that the current digit sum is 65 65 , so we must have 104 65 = 39 104-65=39 more. In addition, the digit sum of 2 n 2n so far would be 1 + 7 + 7 + 7 + 7 + 5 + 5 + 5 + 3 + ( 2 or 3 ) = 50 or 49 1+7+7+7+7+5+5+5+3+(2\text{ or }3)=50\text{ or }49 where the sum is unclear because we don't know if the next digit will carry or not.

Now let us assume that the next digit is a 5 5 . That means that the sum so far of 2 n 2n is 50 50 because 2 × 5 2\times 5 carries over 1 1 .

Now, note that for all digits 0 4 0\rightarrow 4 , we have that the digit sum of 2 n 2n is always twice the digit sum of n n . Because 2 × 39 50 2\times 39\ne 50 , we must have at least one 5 5 in 2 n 2n to balance it out.

Now let's do some simple casework: if there is one 5 5 , then the digit sum of n n not including the digits given is 34 34 and the digit sum of 2 n 2n (again not including the digits given) is 50 50 . Obviously 34 × 2 50 34\times 2\ne 50 so we consider the next case.

If there are two 5 5 's, then the digit sum of n n is 29 29 and the digit sum of 2 n 2n is 49 49 . Since 29 × 2 49 29\times 2\ne 49 , we move on to the next case.

If there are three 5 5 's, then the digit sum of n n is 24 24 and the digit sum of 2 n 2n is 48 48 . Since 24 × 2 = 48 24\times 2=48 , this is our working case and so the answer is 3 \boxed{3} fives.

I think there is a pretty simple solution to this. As you mentioned, the sum of the given numbers is 65, so the sum of the other numbers, 1, 2, 3, 4, and 5, is 39.

When we double 8, we get a new 1 and a 6, so the new sum would be 7. When we double 7, we get a new 1 and a 4, so the new sum would be 5, and when we double 6, we get a new 1 and a 2, so the new sum would be 3.

Thus the digit sum of 2n is

\begin{align} 4 \times 7 + 3 \times 5 + 2 \times 3 + s = 100 \\ s = 51 \end{align}

So the new sum of the doubled numbers will be 51.

Well, when we double 1, 2, 3, and 4, the digit sum is doubled, but when we double 5, the digit sum becomes 1 + 0 = 1.

Thus we can make an equation where we solve for the number of 5s. The sum of all non-5 numbers when there are x 5s is

\begin{align} 39 - 5x \end{align}

In 2n, this sum is doubled. Also, for every 5, we add 1 to the digit sum of 2n. We can get the equation

\begin{align} 2(39 - 5x) + x = 51 \end{align}

So

\begin{align} 78 - 10x + x = 51 \\ 27 = 9x \\ \boxed{x = 3} \end{align}

Also, if someone could teach me how to Latex, that would be great

Matt L - 7 years, 5 months ago

Log in to reply

Darn. You beat me to it. :P

Also, to render in-line LaTeX, use these before and after your equations: \ ( \ )

x = b ± b 2 4 a c 2 a x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} is equivalent to \ ( x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \ ).

Josh Petrin - 7 years, 5 months ago

*( 39 - 5x \ In~ 2n, ~this~ sum~ is~ doubled.~ Also,~ for~ every~ 5 ,\ we~ add ~1~ to~ the~ digit~ sum ~of ~2n.~ We ~can ~get~ the~ equation \ 2(39 - 5x) + x = 51 .~~~~~~ So \ 78 - 10x + x = 51 \ 27 = 9x \ \boxed{x = 3} *) ......................In the above just replace * with \. Copy in your solution.

Niranjan Khanderia - 6 years, 10 months ago

Sorry for the long and ungainly solution. I was rushing a bit :(

Daniel Liu - 7 years, 5 months ago

Log in to reply

Do you think this solution involves too much assumption here, especiially in "Now let us assume that the next digit is a 5."

minimario minimario - 7 years, 5 months ago

Log in to reply

It works out, so it's fine.

Daniel Liu - 7 years, 5 months ago

Log in to reply

@Daniel Liu Well, it only works fine because the question was about "the number of 5 5 s", and not "the largest possible number of 5 s 5s " or the "smallest possible number of 5 5 s". Here is the a solution without any assumptions.

Observe that whenever a number is added to itself, the sum of the digits is twice the sum of the digits of the original number minus 9 9 times the number of carryovers. The carryovers occur exactly when a digit 5 , 6 , 7 , 8 , 5,6,7,8, or 9 9 is added to itself, regardless of whether there was a carryover before that. So the total number of digits 5 , 6 , 7 , 8 , 9 5,6,7,8,9 is 2 104 100 9 = 12. \frac{2\cdot 104 -100}{9}=12. Since we are given that there are exactly 9 9 digits that are 6 6 or more, the number of 5 5 s must be 3. 3.

Alexander Borisov - 7 years, 5 months ago

Log in to reply

@Alexander Borisov what about this answer: 33330909090667778888

A Former Brilliant Member - 7 years, 5 months ago

Log in to reply

@A Former Brilliant Member The first sentence of the problem question says that the integer does not have any 9 s . 9s.

Alexander Borisov - 7 years, 5 months ago

Log in to reply

@Alexander Borisov oh! come on! i thought that the sentence reads "contains a number of 9's!!

A Former Brilliant Member - 7 years, 5 months ago

@Alexander Borisov can you try to phrase the problem's a bit more clearly?

A Former Brilliant Member - 7 years, 5 months ago

@Alexander Borisov Congratulations. According to me, your is the only complete answer.

Niranjan Khanderia - 6 years, 10 months ago

On an unrelated note, the problem source is Cayley 2012 (Canadian contest!)

Jonathan Wong - 7 years, 5 months ago

what about this answer: 33330909090667778888

A Former Brilliant Member - 7 years, 5 months ago

Log in to reply

NO NINES MATE !!!NO NINES

Shivam Rastogi - 7 years, 4 months ago

you cannot use 9

Subhajit Ghosh - 6 years, 6 months ago
Abhisek Nanda
Sep 20, 2015

Well I did a combination of 1,2,3,4,5 to get 104... I found 3 5s, 2 4s and 1 1,2,3 each sums up to 104

Since location of digits are unknown, hit and trial worked and I had no idea how to use other info - 2n and 100

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...