Find the smallest positive integer n such that the digit sums of n as well as n + 1 are divisible by 10.
Enter 666 if you come to the conclusion that no such number exists.
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.
I misunderstood the problem and got 19 as my first attempt. I thought you meant digit sum of n is divisible by 1 0 and n + 1 is divisible by 1 0 . Should the problem be rephrased? Or is it just my understandings in English are weak?
Log in to reply
The digit sum of 1 9 + 1 = 2 0 is 2, which fails to be divisible by 10.
Log in to reply
What he actually meant was that the question sounds a bit more like "digit sum of n " is divisible by 1 0 and ( n + 1 ) is divisible by 1 0 .
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 such that the digit sums of n as well as that of n + 1 are divisible by 10."
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 as well as that of n + 1 ..."
Log in to reply
@Otto Bretscher – Oh, you used "sums". Didn't notice that now. Then yes, there's no ambiguity.
same with me bro .......
Same Way, Gem of a question.
Great question. Sir can u give me a source to learn divisibility check for primes ?
Log in to reply
I'm no Prof Bretscher but here's my contribution:
Most numbers p that satisfy a p − 1 ≡ 1 ( m o d p ) for all 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 ) different numbers a .) There are, however, composite numbers that pass the test, and they are called Carmichael numbers. Also, do look up the AKS primality test.
Log in to reply
Thanks but will u show what is π(p)?
Log in to reply
@Shyambhu Mukherjee – it is a function that returns no. of primes ≤ p. read more
Interesting, but I don't quite see how your remarks relate to the problem at hand. Can you enlighten us?
is 19 not a viable answer? 1+9 being 10 and 19+1 being 20?
Log in to reply
The digit sum of 20 is not divisible by 10.
Log in to reply
yeah, i read it as n+1 had to be divisible by 10, not the digit sum of n+1
19 is also possible. if 19 be n 1+9 and 19+1 is also divisible by 10 it satisfies the given question
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.
i did the same thing. this is a very awesome problem and very awesome solution.
This is one of the nicest number theory problems I've seen here in a while. Nice solution too. +1 :)
your sol is wrong
Clearly, a solution exists because 1 1 1 1 1 1 1 1 1 0 9 9 9 9 9 9 9 9 9 satisfies the property, so don't input 6 6 6 , however, it isn't the smallest solution so don't input it either.
Let S ( n ) be the digit sum of n . I claim n ends in a 9 . If it didn't, we know S ( n ) ≡ 0 m o d 1 0 , and so S ( n + 1 ) ≡ S ( n ) + 1 ≡ 1 m o d 1 0 , so it couldn't be a solution. Thus, n ends in a 9 .
In fact, let n end in k 9 s, for some k ≥ 1 . Then 0 ≡ S ( n + 1 ) = S ( n ) + 1 − 9 k ≡ 1 − 9 k m o d 1 0 ⇒ 9 k ≡ 1 m o d 1 0 ⇒ k ≡ 9 m o d 1 0 .
So the least number of 9 s n must end in is 9 . Lastly, the remaining digits must sum to be congruent to 9 m o d 1 0 , so to keep the number as small as possible, we choose them to be 1 8 . Therefore, the full number must be 1 8 9 9 9 9 9 9 9 9 9
Exactly what I did! Also, very well written formal solution. +1 :)
Same way! Nice work explaining the logic.
...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 × 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 × 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: 1 8 9 9 9 9 9 9 9 9 9
Problem Loading...
Note Loading...
Set Loading...
Suppose n ends in k 9's (but not k + 1 ), with k ≥ 0 , so that n = . . . a 9 9 . . . 9 9 and n + 1 = . . . ( a + 1 ) 0 0 . . . 0 0 for some digit 0 ≤ a ≤ 8 . Now the difference of the digit sums of n and n + 1 , which is 9 k − 1 , must be divisible by 10; the smallest solution is k = 9 . A moment's thought will convince you that the smallest integer that satisfies the requirements is 1 8 9 9 9 9 9 9 9 9 9
Source