Think big

Find the smallest positive integer n n such that the digit sums of n n as well as n + 1 n+1 are divisible by 10.

Enter 666 if you come to the conclusion that no such number exists.


Not an original question.


The answer is 18999999999.

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

Otto Bretscher
Nov 9, 2015

Suppose n n ends in k k 9's (but not k + 1 k+1 ), with k 0 k\geq 0 , so that n = . . . a 99...99 n=...a99...99 and n + 1 = . . . ( a + 1 ) 00...00 n+1=...(a+1)00...00 for some digit 0 a 8 0\leq a \leq 8 . Now the difference of the digit sums of n n and n + 1 n+1 , which is 9 k 1 9k-1 , must be divisible by 10; the smallest solution is k = 9 k=9 . A moment's thought will convince you that the smallest integer that satisfies the requirements is 18999999999 \boxed{18999999999}

Source

I misunderstood the problem and got 19 as my first attempt. I thought you meant digit sum of n n is divisible by 10 10 and n + 1 n+1 is divisible by 10 10 . Should the problem be rephrased? Or is it just my understandings in English are weak?

Christopher Boo - 5 years, 6 months ago

Log in to reply

The digit sum of 19 + 1 = 20 19+1=20 is 2, which fails to be divisible by 10.

Otto Bretscher - 5 years, 6 months ago

Log in to reply

What he actually meant was that the question sounds a bit more like "digit sum of n n " is divisible by 10 10 and ( n + 1 ) (n+1) is divisible by 10 10 .

I was lucky enough to interpret the question as you intended but that might not the case for everyone. I think the question would be better worded as :

"Find the smallest positive integer n n such that the digit sums of n n as well as that of \color{#D61F06}{\textrm{that of }} n + 1 n+1 are divisible by 10."

Prasun Biswas - 5 years, 6 months ago

Log in to reply

@Prasun Biswas Oh, I get it now. There is no ambiguity, though, since I use the plural, "digit sums". It makes no sense to say that "the digit sums of n n as well as that of n + 1 n+1 ..."

Otto Bretscher - 5 years, 6 months ago

Log in to reply

@Otto Bretscher Oh, you used "sums". Didn't notice that now. Then yes, there's no ambiguity.

Prasun Biswas - 5 years, 6 months ago

same with me bro .......

Abhisek Mohanty - 5 years, 4 months ago

Same Way, Gem of a question.

Kushagra Sahni - 5 years, 7 months ago

Great question. Sir can u give me a source to learn divisibility check for primes ?

Shyambhu Mukherjee - 5 years, 7 months ago

Log in to reply

I'm no Prof Bretscher but here's my contribution:

Most numbers p p that satisfy a p 1 1 ( m o d p ) a^{p-1} \equiv 1 \pmod{p} for all a a coprime tend to be prime. Basically, this is a checking of the converse of Fermat's little theorem. (Note that you only need to test π ( p ) \pi(p) different numbers a a .) There are, however, composite numbers that pass the test, and they are called Carmichael numbers. Also, do look up the AKS primality test.

Jake Lai - 5 years, 7 months ago

Log in to reply

Thanks but will u show what is π(p)?

Shyambhu Mukherjee - 5 years, 7 months ago

Log in to reply

@Shyambhu Mukherjee it is a function that returns no. of primes ≤ p. read more

Aareyan Manzoor - 5 years, 7 months ago

Interesting, but I don't quite see how your remarks relate to the problem at hand. Can you enlighten us?

Otto Bretscher - 5 years, 7 months ago

is 19 not a viable answer? 1+9 being 10 and 19+1 being 20?

al morton - 5 years, 7 months ago

Log in to reply

The digit sum of 20 is not divisible by 10.

Otto Bretscher - 5 years, 7 months ago

Log in to reply

yeah, i read it as n+1 had to be divisible by 10, not the digit sum of n+1

al morton - 5 years, 7 months ago

19 is also possible. if 19 be n 1+9 and 19+1 is also divisible by 10 it satisfies the given question

hariharan shanthakumar - 5 years, 7 months ago

Log in to reply

Digit sum of 20 is 2 which isn't divisible by 10. First correct yourself and then you have the right to say that Otto Bretscher's solution is wrong. His solution is absolutely wonderful. Before pointing out mistakes in others make yourself perfect first. It was very rude as you said that " your solution is wrong" like anything.

Kushagra Sahni - 5 years, 7 months ago

i did the same thing. this is a very awesome problem and very awesome solution.

Aareyan Manzoor - 5 years, 7 months ago

This is one of the nicest number theory problems I've seen here in a while. Nice solution too. +1 :)

Prasun Biswas - 5 years, 7 months ago

your sol is wrong

hariharan shanthakumar - 5 years, 7 months ago

Log in to reply

Care to elaborate as to how is it wrong?

Prasun Biswas - 5 years, 7 months ago
Jason Martin
Nov 12, 2015

Clearly, a solution exists because 1111111110999999999 1111111110999999999 satisfies the property, so don't input 666 666 , however, it isn't the smallest solution so don't input it either.

Let S ( n ) S(n) be the digit sum of n n . I claim n n ends in a 9 9 . If it didn't, we know S ( n ) 0 m o d 10 S(n) \equiv 0 \mod 10 , and so S ( n + 1 ) S ( n ) + 1 1 m o d 10 S(n+1) \equiv S(n)+1 \equiv 1 \mod 10 , so it couldn't be a solution. Thus, n n ends in a 9 9 .

In fact, let n n end in k k 9 9 s, for some k 1 k\ge 1 . Then 0 S ( n + 1 ) = S ( n ) + 1 9 k 1 9 k m o d 10 9 k 1 m o d 10 k 9 m o d 10 0\equiv S(n+1)=S(n)+1-9k \equiv 1-9k \mod 10 \Rightarrow 9k \equiv 1 \mod 10 \Rightarrow k \equiv 9 \mod 10 .

So the least number of 9 9 s n n must end in is 9 9 . Lastly, the remaining digits must sum to be congruent to 9 m o d 10 9 \mod 10 , so to keep the number as small as possible, we choose them to be 18 18 . Therefore, the full number must be 18999999999 18999999999

Exactly what I did! Also, very well written formal solution. +1 :)

Prasun Biswas - 5 years, 7 months ago

Same way! Nice work explaining the logic.

Shreyash Rai - 5 years, 4 months ago
Lu Chee Ket
Jan 17, 2016

...9999 + 1 = ...10000 or ...999999999 + 1 = ...1000000000 or etc. must happen for value of n plus 1 equals to value of (n+1), otherwise, an addition of 1 must not allow both value of n and value (n+1) to be both divisible by 10. The right most digit or least significant figure of integer n must be 9.

Consider 9 + 1 = 10, 9 is not divisible by 10 while 1+0 is also not divisible by 10;

Consider 19 + 1 = 20, 1+9 is divisible by 10 but 2+0 is not divisible by 10;

Consider 819 + 1 = 820, 8+1+9 is not divisible by 10 when 8+2+0 is divisible by 10;

Consider 2819 + 1 = 2820, 2+8+1+9 is divisible by 10 but 2+8+2+0 is not divisible by 10;

Consider 109 + 1 = 110, 2099 + 1 = 2100, 30999 + 1 = 31000, 409999 + 1 = 410000, 5099999 + 1 = 5100000, 60999999 + 1 = 61000000, 709999999 + 1 = 710000000 and 8099999999 + 1 = 8100000000, only n's are divisible by 10 but not (n+1)'s.

With 90999999999 + 1 = 91000000000, it satisfy! Unfortunately, this is not the smallest n.

Sum of digits of n ought to be 9 × \times 10 while sum of digits of (n+1) ought to be 10, for smallest n.

09|999999999 + 1 = 10|000000000 but right hand side of (n+1) makes sum of 1 not divisible by 10.

With 18999999999 + 1 = 19000000000 despite 27999999999 + 1 = 28000000000 and etc. for smallest possible, n = 18999999999 is the answer wanted. It is also found that non-continuous of 9 for right hand side of n cannot satisfy! {0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8} are derived from {0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99, 108} to suggest for × \times 10 above!

Summary: Sum of digits of n must be 90 rather than 0, and sum of digits of (n+1) is 10, for smallest n.

Computing method using ordinary program can hardly help for automatic verification onto big figures. This question is solved mainly by thinking. Once an upper limit was found, 666 was safely denied.

Answer: 18999999999 \boxed{18999999999}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...