Possible last digits

p q = 1 0 n pq=10^{n} , where p p , q q and n n are positive integers, p > q p>q and neither of p p or q q ends in zero. What is the sum of the possible values of the last digit of p q p-q ?


The answer is 20.

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.

1 solution

Guilherme Niedu
Mar 18, 2017

Since p > q p>q , and these terms cannot contain factors of both 2 2 and 5 5 , hence p p is the power of 5 5 and q q is the power of 2 2 .

So, q q has to be a power of 2 2 , i.e. q = 2 n q=2^n and p p has to be the same power, but of 5 5 instead of 2 2 , i.e. p = 5 n p=5^n .

This means that p p will always be odd and q q will always be even. So p q p-q will always be odd, and will possibly be, at first, ending with 1 , 3 , 5 , 7 , 9 1,3,5,7,9 .

But 5 5 is not possible, since p p will always end in 5 5 and, for p q p-q to end in 5 5 , q q would have to end in 0 0 which is not possible, since it is a power of 2 2 .

The other vales, 1 , 3 , 7 , 9 1,3,7,9 , are attainable for q q ending in 4 , 2 , 8 , 6 4,2,8,6 respectively, which are all possible last digits for a power of 2 2 .

So the possible values are 1 , 3 , 7 , 9 1,3,7,9 , which sum up to 20 \color{#3D99F6} \fbox{20} . In fact, the values appear periodically in order 3 , 1 , 7 , 9 , 3 , 1 , 7 , 9... 3, 1,7, 9,3,1,7,9... for n = 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8... n = 1,2,3,4,5,6,7,8...

actually you would get the same answer without the constraint p > q p>q :)

Anirudh Sreekumar - 4 years, 2 months ago

Log in to reply

Yeah, but the constraint is imposed in the question :)

Guilherme Niedu - 4 years, 2 months ago

For completeness, in the first line, you should explain that "since p > q p > q , and these terms cannot contain factors of both 2 and 5, hence p p is the power of 5 and q q is the power of 2."

Calvin Lin Staff - 4 years, 2 months ago

Log in to reply

Want me to add this piece of text in the beginning? I didn't do this because I thought that, with the constraint imposed, that was clear.

Guilherme Niedu - 4 years, 2 months ago

Log in to reply

Yes please. For solutions, think about writing it for someone who doesn't know what to do with the problem. That's why it's best to explain all the logical reasoning steps that are taken. Thanks!

Calvin Lin Staff - 4 years, 2 months ago

Log in to reply

@Calvin Lin Changed it. Thanks, Calvin! I always try to elaborate solutions this way, but sometimes I miss it. Thanks again.

Guilherme Niedu - 4 years, 2 months ago

Log in to reply

@Guilherme Niedu Looks great now :)

Yes, it does take some getting used to understanding how much we can assume that the reader has worked out / is able to connect the dots.

Calvin Lin Staff - 4 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...