A positive integer N is divisible by 2014. Find the smallest possible value of the digit sum of N .
Details and assumptions
The digit sum of a number is the sum of all its digits. For example the digit sum of 1123 is 1 + 1 + 2 + 3 = 7 .
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.
Thanks for including your motivation in this solution. How did you find the number with digit sum 3?
Log in to reply
Well, note that 1 0 a + 1 0 b + 1 ≡ 0 ( m o d 5 3 ) . We know the residues of 1 0 k m o d 5 3 , and I noticed a few pairs that add up to 5 2 (namely ( 1 0 , 4 2 ) , ( 3 6 , 1 6 ) , ( 2 4 , 2 8 ) , corresponding to ( k 1 , k 2 ) = ( 1 , 5 ) , ( 4 , 1 2 ) , ( 8 , 9 ) ). I also prepare the residues of 1 0 k m o d 1 9 , and matches those values of ( k 1 , k 2 ) I found. Noting that 1 0 1 3 ≡ 1 m o d 5 3 , we can increase the exponent of any of the multiples of 1 3 , thereby changing its residue modulo 1 9 while keeping it invariant modulo 5 3 .
For example, let f ( k ) = 1 0 k m o d 1 9 ; note that f ( k + 1 8 ) = f ( k ) by Euler's theorem. We take the solution ( k 1 , k 2 ) = ( 5 , 1 ) , so we have 1 0 5 + 1 0 1 + 1 ≡ 0 ( m o d 5 3 ) .
Since f ( 1 ) = 1 0 , f ( 5 ) = 3 , we have 1 0 5 + 1 0 1 + 1 ≡ 3 + 1 0 + 1 ≡ 1 4 ( m o d 1 9 ) ; this is not one we're looking for. We can advance 1 and 5 by any multiple of 1 3 ; for example, taking 1 4 = 1 + 1 3 instead of 1 , we still have 1 0 5 + 1 0 1 4 + 1 ≡ 0 ( m o d 5 3 ) , but now as f ( 1 4 ) = 1 6 , we have changed the residue modulo 1 9 to be 1 0 5 + 1 0 1 4 + 1 ≡ 3 + 1 6 + 1 ≡ 1 ( m o d 1 9 ) . In this case, if we fix 5 and change 1 to 7 9 = 1 + 6 ⋅ 1 3 , we have 1 0 5 + 1 0 7 9 + 1 ≡ 0 ( m o d 5 3 ) , and f ( 7 9 ) = f ( 4 ⋅ 1 8 + 7 ) = f ( 7 ) = 1 5 so 1 0 5 + 1 0 7 9 + 1 ≡ 3 + 1 5 + 1 ≡ 0 ( m o d 1 9 ) , thus 1 0 7 9 + 1 0 5 + 1 is divisible by 1 0 0 7 and hence 1 0 8 0 + 1 0 6 + 1 0 is divisible by 2 0 1 4 .
To find the smallest number, I just do more brute force after that, trying each pair and finding the smallest numbers.
Note that you don't have to check the first 1 3 residues ( m o d 5 3 ) . If there exists a n such that 1 0 n ≡ − 1 ( m o d 5 3 ) , then we must have 1 0 2 n ≡ 1 ( m o d 5 3 ) , so 2 n has to be a multiple of ord 1 0 ( 5 3 ) = 1 3 . Since g cd ( 2 , 5 3 ) = 1 , n must be a multiple of 1 3 . But we know that 1 0 1 3 ≡ 1 ( m o d 5 3 ) , so for any n ≡ 0 ( m o d 1 3 ) , 1 0 n ≡ ( 1 0 1 3 ) 1 3 n ≡ 1 ( m o d 5 3 )
Log in to reply
Nice! I missed that. But I suppose we still need the residues to find out a construction for digit sum 3 (otherwise it might be possible that no pair of residues of 1 0 n m o d 5 3 add up to − 1 )?
Log in to reply
That's what I couldn't do. We can find a multiple of 2 0 1 4 with digit sum 3 by looking at the residues of 1 0 n ( m o d 5 3 ) , but don't you think that makes it too brute-forcey?
Log in to reply
@Sreejato Bhattacharya – You just have 13 residues to work with, and you may assume that one of them is 1. So there's just 1 3 × 1 3 pairs of sums to look at.
Of course, this approach gets more complicated when the minimum digit sum is much higher.
Log in to reply
@Calvin Lin – I am sorry if this is incorrect, but do we just have to go through the 1 6 9 possible sums? That seems a lot of work to do, and almost impossible with computational aid.
I computed the residues of 1 0 n ( m o d 5 3 ) up to n = 7 , and found out that there exists a multiple of 2 0 1 4 with digit-sum 5 . The rest was guesswork:- Brilliant allows three tries, and the answer must be in the set { 3 , 4 , 5 } .
Is there an approach without looking at the 1 3 2 sums ( m o d 5 3 ) (I an very sorry if this is incorrect)?
Log in to reply
@Sreejato Bhattacharya – Assuming you want to figure out a solution of digit sum 3 according to my method above, we only have to obtain the 1 3 residues, and for each residue a , check whether 5 2 − a is also a residue. We only need to find a pair that sums to 5 2 . Unless I mistake your question.
Regarding how to compute 1 0 n m o d 5 3 (I use m o d n for the operation and ( m o d n ) for the arithmetic ), you can simply compute 1 0 n + 1 m o d 5 3 from 1 0 n m o d 5 3 . Multiplying by 1 0 and taking the residue when divided by 5 3 seems to be not too terrible (although still time-consuming).
Good job, I couldn't find any more elegant method either, just had to brute force to find the periods of 1 0 m o d 1 9 and m o d 5 3 . Seemed a bit tougher than the usual 180pt, unless there is a trick nobody has seen yet!
Log in to reply
Considering the fact that problems in Brilliant often require tedious brute-forcing (the n ♡ problem posed a few weeks back, for example), I'm starting to think this was the intended solution. But yes, I admit, this was harder than a usual 180 points problem. This one was even harder than the 230 points problem this week.
Log in to reply
This might be of interest, with regards to the period of 10 modulo primes. It is useful to know when 10 is a primitive element.
It was a good idea to reveals how you approached the problem....THANKS!
Let's start with numbers with the smallest digit sum and see where it leads us. For digit sum 1 the only possibility is N = 1 0 k for some k , which is impossible because 2 0 1 4 has prime factors different from 2 and 5 .
For digit sum 2 there are two possibilities. Either N = 2 ⋅ 1 0 k which doesn't work for the same reason as above or N = 1 0 k + 1 0 l . In this case, observe that there is no factor of 5 in 2 0 1 4 , so that we can divide N by 1 0 l and study instead the divisibility of N ′ = 1 0 n + 1 by 2 0 1 4 / 2 = 1 0 0 7 . Because 1 0 0 7 = 1 9 ⋅ 5 3 , by chinese remainder theorem we have to solve the congruences 1 0 n + 1 ≡ 0 ( m o d 1 9 ) , 1 0 n + 1 ≡ 0 ( m o d 5 3 ) . The only remainders of 1 0 n modulo 5 3 are 1 , 1 0 , 4 7 , 4 6 , 3 6 , 4 2 , 4 9 , 1 3 , 2 4 , 2 8 , 1 5 , 4 4 , 1 6 , so there is no solution for digit sum equal to 2 .
We failed previously but we learned something valuable. Namely, that it's enough to investigate simple congruences modulo 1 9 and 5 3 . We notice above that 4 2 is a remainder of 1 0 n , so that 1 0 n + 1 1 ≡ 0 ( m o d 5 3 ) does have a solution. And there is a solution modulo 1 9 as well, as 1 0 n generates all of 1 8 non-zero elements of Z / 1 9 Z .
Putting this together, there is n such that 1 0 n + 1 1 is divisible by both 1 9 and 5 3 and therefore also by 1 0 0 7 . Therefore 1 0 n + 1 + 1 1 0 is divisible by 2 0 1 4 and the answer is 3 .
Can you explain in more details why the same n could work modulo 5 3 and 1 9 ?
Log in to reply
Sure. We want to solve n ≡ 5 ( m o d 1 3 ) (this is when the remainder of 1 0 n is 4 2 ) and similarly n ≡ 1 5 ( m o d 1 8 ) (giving the remainder of 8 ). The reason these congruences appear is that the order of 1 0 is 1 3 , i.e. 1 0 1 3 ≡ 1 ( m o d 5 3 ) , as an element of the multiplicative group of Z / 5 3 Z and 1 8 in mult. group of Z / 1 9 Z (this was already mentioned implicitly in terms of generation of the said group). Since 1 3 and 1 8 are coprime, it's possible to solve these congruences. Even explicitly by using Euclid's algorithm.
Log in to reply
If anyone is interested, the smallest such n = 2 1 3 = 5 + 1 6 ⋅ 1 3 = 1 5 + 1 1 ⋅ 1 8 . So, N = 1 0 2 1 4 + 1 1 0 is an explicit answer to the problem. That being said, there are surely smaller examples given by 1 0 k + 1 0 l + 1 0 for various values of k and l .
Log in to reply
That being said, there are surely smaller examples
Indeed, I don't know what the smallest one is either, but just as an easy example we could modify your number to
\( 10^{21}(
10^{235}+11\cdot 10^{22} \equiv 10+11\cdot 10^{22} \)
or 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 .
what is the number N ???
Souryajit Roy 2014=2x19x53. Consider the powers of 10 mod 53.They are as follows 10, 47, 46, 36, 42, 49, 13, 24, 28, 15, 44, 16, 1. Consider the powers of 10 mod 19.They are : 10, 5, 12, 6, 3, 11, 15, 17, 18, 9, 14, 7, 13, 16, 8, 4, 2, 1 . The powers of 10 mod 2 are 1 or 0 Since neither 0 nor 52 occurs in the list for 53,the minimum digit sum is 3. 10^52=1(mod 53) by Fermat's theorem and hence 10^13n=1(mod 53) if n is a multiple of 4. Also see 10^5=42(mod 53).Therefore, 10^(13n+5)=42(mod 53) if n is a multiple of 4. Hence, 1+10+10^(13n+5)=53=0(mod 53). The above expression is also divisible by 19 if 10^(13n+5)=8(mod 19). By Fermat's theorem 10^18=1(mod 19) and hence 10^18n=1(mod 19). Note that 10^5=3(mod 19) and so 10^15=3^3=8(mod 19). Hence,10^k=8(mod 19) if k=15(mod 18). Hence,we require 13n+5=15(mod 18) with a solution n=16,a multiple of 4. It follows that 1 + 10 + 10^(5+13*16) = 1 + 10 + 10^213 is divisible by both 19 and 53. At last,10 + 10^2 + 10^214 is divisible by 2, 19, and 53, and therefore it is divisible by 2014. The digit sum for this number is 3.
I found a solution with 5. Then I tried 4 and finally 3 !!!
Problem Loading...
Note Loading...
Set Loading...
Main idea : Try each digit sum from the smallest, and see 5 3 doesn't divide numbers with digit sum less than 3 . Also brute force 1 0 n m o d 5 3 by computer.
Complete proof :
Note that 2 0 1 4 = 2 ⋅ 1 9 ⋅ 5 3 .
First, note that 1 0 2 3 + 1 0 2 2 + 1 0 is divisible by 2 0 1 4 (if you like working, you can compute by hand; I personally used Python), and it has digit sum 3 . So we get an upper bound of the minimum to be 3 . Now we will prove that a digit sum of 1 or 2 is impossible.
If the digit sum is 1 , then our number must be in the form of 1 0 k = 2 k 5 k , not containing the factor 1 9 or 5 3 . So this is clearly impossible.
If the digit sum is 2 , then our number must be in the form of 1 0 a + 1 0 b ; WLOG assume that a ≥ b . So our number is in the form 1 0 b ( 1 0 k + 1 ) where k = a − b ≥ 0 . Again, since 1 0 b = 2 b 5 b doesn't contain the factor 5 3 , then 1 0 k + 1 must contain the factor 5 3 ; in other words, 1 0 k + 1 ≡ 0 ( m o d 5 3 ) , or 1 0 k ≡ − 1 ≡ 5 2 ( m o d 5 3 ) .
However, we observe that 1 0 1 3 ≡ 1 ( m o d 5 3 ) (Python), so the residues upon dividing by 5 3 will be periodic with period 1 3 . Also, we can verify that 1 0 k ≡ 1 , 1 0 , 4 7 , 4 6 , 3 6 , 4 2 , 4 9 , 1 3 , 2 4 , 2 8 , 1 5 , 4 4 , 1 6 ( m o d 5 3 ) (Python). Since we have 1 3 residues, these are all possible residues, and it can be trivially seen that 5 2 is not among those residues, so there is no integer k making 1 0 k ≡ − 1 ≡ 5 2 ( m o d 5 3 ) . In other words, 1 0 k + 1 is never divisible by 5 3 .
So our number 1 0 a + 1 0 b is not divisible by 5 3 , and hence the digit sum 2 fails. So the lower bound of the minimum is 3 . As we have shown a model that 3 works, our answer is thus 3 .
Motivation (or my solving path) :
Since we want to find the smallest digit sum, I went up from the smallest possible digit sum. The smallest, 1 , was trivially discarded. After that, initially I thought 1 0 k + 1 takes all residues for any integer N not divisible by 2 or 5 , so I submitted 2 , and got wrong. So then I factorized 2 0 1 4 = 2 ⋅ 1 9 ⋅ 5 3 , and started coding, to figure out that 1 0 k m o d 5 3 repeats with smallest period 1 3 and not φ ( 5 3 ) = 5 2 as expected. The rest of this path is described in the proof above pretty identically. So that's out of the window too.
Then I went up to 3 , which gives so much freedom in the form of 1 0 a + 1 0 b + 1 , not to mention that the period of 1 0 k ( m o d 1 9 ) is indeed φ ( 1 9 ) = 1 8 , spewing all possible residues except 0 . So if we can figure out a , b satisfying 1 0 a + 1 0 b + 1 = 0 ( m o d 5 3 ) , I can simply increase a by a multiple of 1 3 , keeping 1 0 a + 1 0 b + 1 = 0 ( m o d 5 3 ) , but at the same time rolling over all residues of 1 9 , pretty much guaranteeing a hit. Just for fun, I tried to find the smallest number satisfying the condition; I believe 1 0 2 3 + 1 0 2 2 + 1 0 is indeed the smallest among all having digit sum 3 .
Generalization :
The obvious generalization is changing 2 0 1 4 . We can discard any factor of 2 or 5 in the divisor by appending enough 0 's at the end, so we are left with several prime factors, none of them is 2 or 5 . After this, I think there's no way to proceed except by first brute forcing 1 0 n m o d d for each prime divisor d of N , then trying to figure out some a , b (or more) that makes the sum correct, hoping that you don't hit a bad divisor like 3 7 (whose residues are 1 , 1 0 , 2 6 only!) that makes your problem more insane...