All but One

Each of the digits from 0 to 9 appears in the number 2 29 2^{29} once except for one. Which digit is missing?


Hint: Divisibility Rules

2 4 6 8

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.

15 solutions

Steven Yuan
Dec 17, 2017

Relevant wiki: Modular Arithmetic - Problem Solving - Basic

To find the missing digit, we use the fact that the digital sum of any integer N N is congruent to N ( m o d 9 ) . N \! \pmod{9}. Here's a quick proof of why this is:

Let N = 1 0 n a n + 1 0 n 1 a n 1 + + 10 a 1 + a 0 , N = 10^n a_n + 10^{n - 1}a_{n - 1} + \cdots + 10a_1 + a_0, where the a i a_i are digits i.e. integers between 0 and 9 inclusive. Taking this expression modulo 9 yields

N 1 0 n a n + 1 0 n 1 a n 1 + + 10 a 1 + a 0 1 n a n + 1 n 1 a n 1 + + 1 a 1 + a 0 a n + a n 1 + + a 1 + a 0 ( m o d 9 ) . \begin{aligned} N &\equiv 10^n a_n + 10^{n - 1}a_{n - 1} + \cdots + 10a_1 + a_0 \\ &\equiv 1^n a_n + 1^{n - 1}a_{n - 1} + \cdots + 1a_1 + a_0 \\ &\equiv a_n + a_{n - 1} + \cdots + a_1 + a_0 \! \! \! \! \pmod{9}. \end{aligned}

Since a n + a n 1 + + a 1 + a 0 a_n + a_{n - 1} + \cdots + a_1 + a_0 is precisely the digital sum of N , N, we conclude that the digital sum of any positive integer is congruent to that integer modulo 9.

Now, because

2 29 2 27 2 2 ( 2 3 ) 9 4 ( 1 ) 9 4 4 ( m o d 9 ) , 2^{29} \equiv 2^{27}\cdot2^2 \equiv (2^3)^9 \cdot 4 \equiv (-1)^9 \cdot 4 \equiv -4 \! \! \! \! \pmod{9},

the digital sum of 2 29 2^{29} is equivalent to -4 modulo 9. It is given in the problem that 2 29 2^{29} contains all digits between 0 and 9 except for one. (Note that 1 0 8 < 2 29 < 1 0 9 , 10^8 < 2^{29} < 10^9, so 2 29 2^{29} has 9 digits, meaning every digit except for one of them must be included in it.) The sum of all these digits is congruent to 0 mod 9, so the missing digit d d is the one that will make 2 29 + d 2^{29} + d be divisible by 9. This digit must be congruent to 4 modulo 9, and since it is a digit, the only possible value that works is d = 4 . d = \boxed{4}.

Moderator note:

It is helpful to know that log 10 2 0.301 \log_{10} 2 \approx 0.301 (and log 10 3 0.477 \log_{10} 3 \approx 0.477 ). As such, we can calculate that 29 log 10 2 8.729 29 \log_{10} 2 \approx 8.729 and hence it has 9 digits.

Alternatively, using 1. 2 3 = 1.728 < 2 1.2^3 = 1.728 < 2 , we know that 2 10 = 1024 < 1200 < 3 [ 2 ] × 1 0 3 2^{10} = 1024 < 1200 < \sqrt{3}[2] \times 10^3 . Now, cubing both sides and simplifying gives us 2 29 < 1 0 9 2^{29} < 10^9 .

I think this argument is flawed, though the answer is correct. In addition to all digits except one appearing, it is also necessary that all the digits that appear, do so only once.

Example : Consider the number 2 31 + 1 2^{31}+1 . It has all the digits from 1 1 to 9 9 appearing in it, except for one.

Going by this logic ( 2 31 + 1 ) ( ( 2 3 ) 10 2 + 1 ) ( 1 ) 10 2 + 1 ( 6 ) m o d 9 (2^{31}+1) \equiv ((2^3)^{10} \cdot 2 + 1) \equiv (-1)^{10} \cdot 2 + 1 \equiv (-6) \mod 9 . Which suggests 6 6 as the missing number.

However, 2 31 + 1 = 2147483649 2^{31}+1 = 2147483649 . The number missing is 5 5 .

Janardhanan Sivaramakrishnan - 3 years, 5 months ago

Log in to reply

I think the idea is that the problem tells you that every one of the digits from 0 0 to 9 9 appears in the number, except for one particular digit. It might be a good idea to include a little argument in the proof though, wherein we see 1 0 9 < 2 29 < 1 0 10 , 10^9<2^{29}<10^{10}, and thus every other digit must appear exactly once. Alternatively, you could rephrase the problem to read:

Given that 2 29 2^{29} is a 9 9 -digit number with all its digits distinct, what is the one digit missing?

Miles Koumouris - 3 years, 5 months ago

Log in to reply

When I first attempted the problem, I interpreted the wording to mean that each digit was included exactly once except for one of them and didn't stop to think that there might have been duplicates. And I had already seen the problem in a different competitive setting, so there's that.

In any case, I put a small note in the middle of my solution to address this issue with the digits.

Steven Yuan - 3 years, 5 months ago

Isn't 1 0 8 < 2 29 < 1 0 9 10^8 < 2^{29} < 10^9 ?

Paul Schmidt - 3 years, 5 months ago

Log in to reply

@Paul Schmidt Oh yeah, you're right. I've corrected that in my solution. Thanks!

Steven Yuan - 3 years, 5 months ago

@Paul Schmidt Is there some way to derive this without calculating the value of 2^29? Else, there is no need to do all the additional calculations to determine that the "4" is missing.

Joseph Giri - 3 years, 5 months ago

Log in to reply

@Joseph Giri 2^3 is single digit, so 2^30 can at the most be 10 digits (also is). Accordingly 2^29 can at the most be 9 digits.

Steen Grode - 3 years, 5 months ago

Log in to reply

@Steen Grode Not quite, or there is a slight step that you're missing. While it is true that " 2^3 is single digit, so 2^30 can at the most be 10 digits", how does that explain "Accordingly 2^29 can at the most be 9 digits"?

For example, if we can also show that "2^31 can at the most be 10 digits (also is)", does this imply that "Accordingly 2^30 can at most be 9 digits"?

The correct statement (without requiring much more calculation) is that "If 2^30 has 10 digits, then 2^9 has at least 9 digits".

Calvin Lin Staff - 3 years, 5 months ago

It was stated in the question that the digits are unique.

The missing digit is always 9 - (N mod 9) if N is a nine digit number with unique digits

9 - (N mod 9) is also the missing digit for any number of digits if only zero repeats. Example 102030405070809 mod 9 = 3 so the missing digit is 9-3 = 6

2147483649 doesn't work because the digits aren't unique and 4 appears multiple times.

John Morrison - 3 years, 5 months ago

@Christopher Boo please rephrase to the problem to

Each of the digits from 0 to 9 appear in the number 2^29 exactly once except for one. Which digit is missing?

Unless of course there is some other solution you intend this to be solved by

Alex Li - 3 years, 5 months ago

Log in to reply

I do not think it is necessary to add the word "exactly". Can you please explain?

Agnishom Chattopadhyay - 3 years, 5 months ago

Log in to reply

I interpreted the question to mean "at least once". I believe the once has been italicized since, which makes it clearer, but I found the wording ambiguous.

Alex Li - 3 years, 5 months ago

lol i just guessed and got it

Ethan Ould Ould - 2 years, 9 months ago

2 29 = 536870912 2^{29} = 536870912 .

Thus, the missing digit is 4 \boxed{4} .

That is obviously not how you were meant to go about this.

A Former Brilliant Member - 3 years, 5 months ago

Log in to reply

I think it's precisely the way to go about it.

Barry Gomm - 3 years, 5 months ago

Of course it is... "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint-Exupery

Gavin Jackson - 3 years, 5 months ago

Excellent! I believe in computation.

Agnishom Chattopadhyay - 3 years, 5 months ago

That is my kind of solution!

Lee Bowron - 3 years, 5 months ago

Seriously i mean seriously wow what a bad way to answer a question

shashwat singh - 3 years, 5 months ago

Log in to reply

I think this answer is the best, the others seem to be just airings of knowledge

Barry Gomm - 3 years, 5 months ago

This is a bad approach to take to answering questions. Of course direct computation is fine here, but it doesn't exactly help develop your problem solving skills for when you encounter a question about the digits of 2^98123921346.

Joe Harris - 3 years, 5 months ago

Log in to reply

Then maybe a more appropriate question would have been about the digits of 2^98123921346 ?

Gavin Jackson - 3 years, 5 months ago

This is the way I answered it. Why all the proofs when you can use calculations?

Tracey Carr Davis - 3 years, 5 months ago

this process will not work for bigger numbers.

Mohammad Khaza - 3 years, 5 months ago
Leonel Castillo
Jan 1, 2018

Relevant wiki: Euler's Totient Function

Because ϕ ( 9 ) = 6 \phi(9) = 6 we may compute 2 29 2 1 5 m o d 9 2^{29} \equiv 2^{-1} \equiv 5 \mod 9 . On the other hand, a number mod 9 is equal to the sum of digits and the sum of the digits of this number will be 0 + 1 + . . . + 9 x = 45 x 0 + 1 + ... + 9 - x = 45 - x where x is the digit that is missing. We can now solve 45 x 5 m o d 9 x 4 m o d 9 x = 4 45 - x \equiv 5 \mod 9 \implies x \equiv 4 \mod 9 \implies x = 4 .

This is a great solution. Clean way to use Euler's Theorem.

Agnishom Chattopadhyay - 3 years, 5 months ago

Log in to reply

U yourself can't do and praising others

shashwat singh - 3 years, 5 months ago

Leonel Castillo: Elegant solution! James

James Malin - 3 years, 5 months ago

Nice going. I tried a lot of stuff and nothing worked!

John Winkelman - 3 years, 5 months ago

pretty cool...

Morten Silcowitz - 3 years, 4 months ago

nice solution. solutions involve using some very basic theorems.

Srikanth Tupurani - 3 years, 3 months ago
Kelvin Hong
Jan 1, 2018

First, we can expand 2 29 2^{29} as 2 9 × 2 10 × 2 10 = 512 × 1024 × 1024 2^9 \times 2^{10} \times 2^{10} = 512 \times 1024 \times 1024 which is approximately 9-digit number.

So, as the question states, all of the distinct number appear except one number is missing.

So, do this: 2 29 4 × 8 9 4 × ( 1 ) 9 4 × ( 1 ) 4 ( m o d 9 ) 2^{29} \equiv 4 \times 8^{9} \equiv 4 \times (-1)^9 \equiv 4 \times (-1) \equiv -4 (mod 9)

There is a missing 4 \boxed {4}

I don't understand the step where 8^9 becomes -1. Can you explain what that is about. The terminology please

Keith Brookes - 3 years, 5 months ago

Log in to reply

8^9 (mod 9 ) ==( -1 )^9 = -1

Ananya Aaniya - 3 years, 5 months ago

Sorry for that, I have modified it.

Kelvin Hong - 3 years, 5 months ago
William Darr
Jan 4, 2018

2^n Mod(9) has the progression 2,4,8,5,1 repeating Mod(5), 29 Mod(5) = 4, 4th member of progression is 5, 2^29 must then be 5 Mod(9) = -4 Mod(9), Therefore, missing digit is 4

Zach Bian
Jan 1, 2018

As a bash one-liner:

1
num=`dc <<< "2 29 ^ p"`; for i in `seq 0 9`; do echo $num | grep $i 1&>0 || break; done; echo "$i not found"

1
4 not found

Why the not found though?

Agnishom Chattopadhyay - 3 years, 5 months ago

Log in to reply

User friendliness?

Zach Bian - 3 years, 5 months ago
Mike Holden
Jan 3, 2018

Use a calculator to find the decimal equivalent of 2^29. It's 536870912. So 4 is the missing digit.

In exam pls use a calculator...u cheater

shashwat singh - 3 years, 5 months ago
Nikhil Kalghatgi
Jan 1, 2018

To me it is not clear from the problem that these digits only appear once. Hence it is necessary to take l o g 10 log_{10} , or to write: 2 29 = ( 2 10 ) 3 2 = 1024 3 2 2^{29} = \frac{(2^{10})^3}{2} = \frac{{1024}^3}{2} to deduce that the number in question has exactly 9 digits.

I agree that the problem does not prove does not prove that at least 9 digits appear. But why does it need to?

Agnishom Chattopadhyay - 3 years, 5 months ago

2^29=(2^7)^4 2=(128^4) 2=268435456*2=536870912 The only digit that does not appear in this number is 4.

Jeff K
Jan 7, 2018

I do web related development with html, javascript and php. So, it is trivial to execute alert(Math.pow(2,29)) in javascript in and read the answer to find out which digit is missing.

2^29 = 536870912 No. 4 is missing...

Since 2 3 1 2^3 \equiv -1 mod 9, we have 2 29 = ( 2 3 ) 9 2 2 ( 1 ) 9 4 = 4 mod 9. 2^{29} = (2^3)^9\cdot 2^2 \equiv (-1)^9\cdot 4 = -4\ \text{mod}\ 9. The sum of all digits 0 , , 9 0,\dots,9 is a multiple of 9, as is easily checked by paring them up ( 0 + 9 , 1 + 8 0 + 9, 1 + 8 , etc.).

Therefore, the missing digit should be 0 ( 4 ) = 4 0 - (-4) = 4 mod 9.

Ron Gerard
Jan 5, 2018

All it requires is two multiplications. 2^29 = 2^10 * 2^9 * 2^10. I assume everyone knows that 2^10 = 1024 and 2^9 = 512. Two minutes with a biro and a scrap of paper. to solve this one.

Jimin Park
Jan 4, 2018

Proper solution: by comparing 0 + + 9 = 45 0 ( m o d 3 ) 0 + \cdots + 9 = 45 \equiv 0 \pmod 3 mod 3 and 2 29 1 ( m o d 3 ) 2^{29} \equiv -1 \pmod 3 the missing number should be 4 1 ( m o d 3 ) 4 \equiv 1 \pmod 3 .

Lazy solution: the sum from 0 to 9 is divisible by 3 where 2 29 2^{29} is not. If the answer were 2 or 8 then I wouldn't be able to pick one. So the answer is 4.

Of course if ( m o d 9 ) \pmod 9 was used instead of ( m o d 3 ) \pmod 3 the reasoning is invalid. But I was too lazy to even think about 2 29 1 ( m o d 3 ) 2^{29} \equiv -1 \pmod 3

Arian Stefanic
Jan 2, 2018

I have no deep understanding of this, but my solution gives me the correct digit.

If we use following formula:

1 ( 1 x ) 2 \frac{1}{(1-x)^2} and use a number smaller than 1, lets say " 1 2 \frac{1}{2} " in our case.

Then we will get 4 as our solution, which is the wanted digit. If that isnt a coincidence, can somebody explain it properly or debunk it?

I do not understand what you mean. What is this formula? How did you get 4?

Agnishom Chattopadhyay - 3 years, 5 months ago

Log in to reply

oh sorry, i made a mistake with the formula, it should be 1/(1-x)^2

Arian Stefanic - 3 years, 5 months ago

I am not following. Are you using? 1 ( 1 x ) 2 = n = 0 n x n 1 = 1 + 2 x + 3 x 2 + = 2 29 \frac{1}{\left( 1 - x \right)^2} = \sum_{n=0}^{\infty} nx^{n-1} = 1 + 2x + 3x^2 + \dots = 2^{29}

Or, possibly? 1 ( 1 x ) 2 = 1 + 2 x + 3 x 2 + + ( n 1 ) x n + ( n + 2 ) x n + 1 ( n + 1 ) x n + 2 ( 1 x ) 2 = 2 29 \frac{1}{\left( 1 - x \right)^2} = 1 + 2x + 3x^2 + \dots + \left( n-1 \right) x^n + \frac{\left(n+2\right) x^{n+1} - \left( n+1\right)x^{n+2}}{\left(1-x\right)^2} = 2^{29}

Here x = 1 2 29 / 2 . x= 1 - 2^{-29/2}. Not 1 / 2 1/2 as you state.

Ron Bannon - 3 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...