Does 2014 work?

A positive integer N N is divisible by 2014. Find the smallest possible value of the digit sum of N 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 1 + 1 + 2 + 3 = 7 .


The answer is 3.

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.

4 solutions

Ivan Koswara
Nov 17, 2013

Main idea : Try each digit sum from the smallest, and see 53 53 doesn't divide numbers with digit sum less than 3 3 . Also brute force 1 0 n m o d 53 10^n \bmod 53 by computer.

Complete proof :

Note that 2014 = 2 19 53 2014 = 2 \cdot 19 \cdot 53 .

First, note that 1 0 23 + 1 0 22 + 10 10^{23} + 10^{22} + 10 is divisible by 2014 2014 (if you like working, you can compute by hand; I personally used Python), and it has digit sum 3 3 . So we get an upper bound of the minimum to be 3 3 . Now we will prove that a digit sum of 1 1 or 2 2 is impossible.

If the digit sum is 1 1 , then our number must be in the form of 1 0 k = 2 k 5 k 10^k = 2^k5^k , not containing the factor 19 19 or 53 53 . So this is clearly impossible.

If the digit sum is 2 2 , then our number must be in the form of 1 0 a + 1 0 b 10^a + 10^b ; WLOG assume that a b a \ge b . So our number is in the form 1 0 b ( 1 0 k + 1 ) 10^b (10^k + 1) where k = a b 0 k = a-b \ge 0 . Again, since 1 0 b = 2 b 5 b 10^b = 2^b5^b doesn't contain the factor 53 53 , then 1 0 k + 1 10^k+1 must contain the factor 53 53 ; in other words, 1 0 k + 1 0 ( m o d 53 ) 10^k+1 \equiv 0 \pmod{53} , or 1 0 k 1 52 ( m o d 53 ) 10^k \equiv -1 \equiv 52 \pmod{53} .

However, we observe that 1 0 13 1 ( m o d 53 ) 10^{13} \equiv 1 \pmod{53} (Python), so the residues upon dividing by 53 53 will be periodic with period 13 13 . Also, we can verify that 1 0 k 1 , 10 , 47 , 46 , 36 , 42 , 49 , 13 , 24 , 28 , 15 , 44 , 16 ( m o d 53 ) 10^k \equiv 1, 10, 47, 46, 36, 42, 49, 13, 24, 28, 15, 44, 16 \pmod{53} (Python). Since we have 13 13 residues, these are all possible residues, and it can be trivially seen that 52 52 is not among those residues, so there is no integer k k making 1 0 k 1 52 ( m o d 53 ) 10^k \equiv -1 \equiv 52 \pmod{53} . In other words, 1 0 k + 1 10^k+1 is never divisible by 53 53 .

So our number 1 0 a + 1 0 b 10^a+10^b is not divisible by 53 53 , and hence the digit sum 2 2 fails. So the lower bound of the minimum is 3 3 . As we have shown a model that 3 3 works, our answer is thus 3 \boxed{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 1 , was trivially discarded. After that, initially I thought 1 0 k + 1 10^k+1 takes all residues for any integer N N not divisible by 2 2 or 5 5 , so I submitted 2 2 , and got wrong. So then I factorized 2014 = 2 19 53 2014 = 2 \cdot 19 \cdot 53 , and started coding, to figure out that 1 0 k m o d 53 10^k \bmod 53 repeats with smallest period 13 13 and not φ ( 53 ) = 52 \varphi(53) = 52 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 3 , which gives so much freedom in the form of 1 0 a + 1 0 b + 1 10^a + 10^b + 1 , not to mention that the period of 1 0 k ( m o d 19 ) 10^k \pmod{19} is indeed φ ( 19 ) = 18 \varphi(19) = 18 , spewing all possible residues except 0 0 . So if we can figure out a , b a,b satisfying 1 0 a + 1 0 b + 1 = 0 ( m o d 53 ) 10^a + 10^b + 1 = 0 \pmod{53} , I can simply increase a a by a multiple of 13 13 , keeping 1 0 a + 1 0 b + 1 = 0 ( m o d 53 ) 10^a + 10^b + 1 = 0 \pmod{53} , but at the same time rolling over all residues of 19 19 , pretty much guaranteeing a hit. Just for fun, I tried to find the smallest number satisfying the condition; I believe 1 0 23 + 1 0 22 + 10 10^{23} + 10^{22} + 10 is indeed the smallest among all having digit sum 3 3 .

Generalization :

The obvious generalization is changing 2014 2014 . We can discard any factor of 2 2 or 5 5 in the divisor by appending enough 0 0 's at the end, so we are left with several prime factors, none of them is 2 2 or 5 5 . After this, I think there's no way to proceed except by first brute forcing 1 0 n m o d d 10^n \bmod d for each prime divisor d d of N N , then trying to figure out some a , b a,b (or more) that makes the sum correct, hoping that you don't hit a bad divisor like 37 37 (whose residues are 1 , 10 , 26 1,10,26 only!) that makes your problem more insane...

Thanks for including your motivation in this solution. How did you find the number with digit sum 3?

Michael Tang - 7 years, 6 months ago

Log in to reply

Well, note that 1 0 a + 1 0 b + 1 0 ( m o d 53 ) 10^a + 10^b + 1 \equiv 0 \pmod{53} . We know the residues of 1 0 k m o d 53 10^k \bmod 53 , and I noticed a few pairs that add up to 52 52 (namely ( 10 , 42 ) , ( 36 , 16 ) , ( 24 , 28 ) (10,42), (36,16), (24,28) , corresponding to ( k 1 , k 2 ) = ( 1 , 5 ) , ( 4 , 12 ) , ( 8 , 9 ) (k_1, k_2) = (1,5), (4,12), (8,9) ). I also prepare the residues of 1 0 k m o d 19 10^k \bmod 19 , and matches those values of ( k 1 , k 2 ) (k_1,k_2) I found. Noting that 1 0 13 1 m o d 53 10^{13} \equiv 1 \bmod 53 , we can increase the exponent of any of the multiples of 13 13 , thereby changing its residue modulo 19 19 while keeping it invariant modulo 53 53 .

For example, let f ( k ) = 1 0 k m o d 19 f(k) = 10^k \bmod 19 ; note that f ( k + 18 ) = f ( k ) f(k+18) = f(k) by Euler's theorem. We take the solution ( k 1 , k 2 ) = ( 5 , 1 ) (k_1, k_2) = (5,1) , so we have 1 0 5 + 1 0 1 + 1 0 ( m o d 53 ) 10^5 + 10^1 + 1 \equiv 0 \pmod{53} .

Since f ( 1 ) = 10 , f ( 5 ) = 3 f(1) = 10, f(5) = 3 , we have 1 0 5 + 1 0 1 + 1 3 + 10 + 1 14 ( m o d 19 ) 10^5 + 10^1 + 1 \equiv 3+10+1 \equiv 14 \pmod{19} ; this is not one we're looking for. We can advance 1 1 and 5 5 by any multiple of 13 13 ; for example, taking 14 = 1 + 13 14 = 1 + 13 instead of 1 1 , we still have 1 0 5 + 1 0 14 + 1 0 ( m o d 53 ) 10^5 + 10^{14} + 1 \equiv 0 \pmod{53} , but now as f ( 14 ) = 16 f(14) = 16 , we have changed the residue modulo 19 19 to be 1 0 5 + 1 0 14 + 1 3 + 16 + 1 1 ( m o d 19 ) 10^5 + 10^{14} + 1 \equiv 3+16+1 \equiv 1 \pmod{19} . In this case, if we fix 5 5 and change 1 1 to 79 = 1 + 6 13 79 = 1 + 6 \cdot 13 , we have 1 0 5 + 1 0 79 + 1 0 ( m o d 53 ) 10^5 + 10^{79} + 1 \equiv 0 \pmod{53} , and f ( 79 ) = f ( 4 18 + 7 ) = f ( 7 ) = 15 f(79) = f(4 \cdot 18 + 7) = f(7) = 15 so 1 0 5 + 1 0 79 + 1 3 + 15 + 1 0 ( m o d 19 ) 10^5 + 10^{79} + 1 \equiv 3+15+1 \equiv 0 \pmod{19} , thus 1 0 79 + 1 0 5 + 1 10^{79} + 10^5 + 1 is divisible by 1007 1007 and hence 1 0 80 + 1 0 6 + 10 10^{80} + 10^6 + 10 is divisible by 2014 2014 .

To find the smallest number, I just do more brute force after that, trying each pair and finding the smallest numbers.

Ivan Koswara - 7 years, 6 months ago

Note that you don't have to check the first 13 13 residues ( m o d 53 ) \pmod{53} . If there exists a n n such that 1 0 n 1 ( m o d 53 ) 10^n \equiv -1 \pmod{53} , then we must have 1 0 2 n 1 ( m o d 53 ) 10^{2n} \equiv 1 \pmod{53} , so 2 n 2n has to be a multiple of ord 10 ( 53 ) = 13 \text{ord}_{10}(53)= 13 . Since gcd ( 2 , 53 ) = 1 \gcd(2, 53)=1 , n n must be a multiple of 13 13 . But we know that 1 0 13 1 ( m o d 53 ) 10^{13} \equiv 1 \pmod{53} , so for any n 0 ( m o d 13 ) n \equiv 0 \pmod{13} , 1 0 n ( 1 0 13 ) n 13 1 ( m o d 53 ) 10^n \equiv \left ( 10^{13} \right ) ^ {\frac{n}{13}} \equiv 1 \pmod{53}

Sreejato Bhattacharya - 7 years, 6 months ago

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 3 (otherwise it might be possible that no pair of residues of 1 0 n m o d 53 10^n \bmod 53 add up to 1 -1 )?

Ivan Koswara - 7 years, 6 months ago

Log in to reply

That's what I couldn't do. We can find a multiple of 2014 2014 with digit sum 3 3 by looking at the residues of 1 0 n ( m o d 53 ) 10^n \pmod{53} , but don't you think that makes it too brute-forcey?

Sreejato Bhattacharya - 7 years, 6 months ago

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 13 × 13 13 \times 13 pairs of sums to look at.

Of course, this approach gets more complicated when the minimum digit sum is much higher.

Calvin Lin Staff - 7 years, 6 months ago

Log in to reply

@Calvin Lin I am sorry if this is incorrect, but do we just have to go through the 169 169 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 53 ) 10^{n} \pmod{53} up to n = 7 n=7 , and found out that there exists a multiple of 2014 2014 with digit-sum 5 5 . The rest was guesswork:- Brilliant allows three tries, and the answer must be in the set { 3 , 4 , 5 } \{3, 4, 5\} .

Is there an approach without looking at the 1 3 2 13^2 sums ( m o d 53 ) \pmod{53} (I an very sorry if this is incorrect)?

Sreejato Bhattacharya - 7 years, 6 months ago

Log in to reply

@Sreejato Bhattacharya Assuming you want to figure out a solution of digit sum 3 3 according to my method above, we only have to obtain the 13 13 residues, and for each residue a a , check whether 52 a 52-a is also a residue. We only need to find a pair that sums to 52 52 . Unless I mistake your question.

Regarding how to compute 1 0 n m o d 53 10^n \bmod 53 (I use m o d n \bmod n for the operation and ( m o d n ) \pmod{n} for the arithmetic ), you can simply compute 1 0 n + 1 m o d 53 10^{n+1} \bmod 53 from 1 0 n m o d 53 10^n \bmod 53 . Multiplying by 10 10 and taking the residue when divided by 53 53 seems to be not too terrible (although still time-consuming).

Ivan Koswara - 7 years, 6 months ago

Good job, I couldn't find any more elegant method either, just had to brute force to find the periods of 10 m o d 19 10 \mod 19 and m o d 53 \mod 53 . Seemed a bit tougher than the usual 180pt, unless there is a trick nobody has seen yet!

Matt McNabb - 7 years, 6 months ago

Log in to reply

Considering the fact that problems in Brilliant often require tedious brute-forcing (the n n \heartsuit 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.

Sreejato Bhattacharya - 7 years, 6 months ago

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.

Calvin Lin Staff - 7 years, 6 months ago

It was a good idea to reveals how you approached the problem....THANKS!

Led Tasso - 7 years, 6 months ago
Marek Bernat
Nov 19, 2013

Let's start with numbers with the smallest digit sum and see where it leads us. For digit sum 1 1 the only possibility is N = 1 0 k N = 10^k for some k k , which is impossible because 2014 2014 has prime factors different from 2 2 and 5 5 .

For digit sum 2 2 there are two possibilities. Either N = 2 1 0 k N = 2 \cdot 10^k which doesn't work for the same reason as above or N = 1 0 k + 1 0 l N= 10^k + 10^l . In this case, observe that there is no factor of 5 5 in 2014 2014 , so that we can divide N N by 1 0 l 10^l and study instead the divisibility of N = 1 0 n + 1 N' = 10^n + 1 by 2014 / 2 = 1007 2014/2 = 1007 . Because 1007 = 19 53 1007 = 19 \cdot 53 , by chinese remainder theorem we have to solve the congruences 1 0 n + 1 0 ( m o d 19 ) , 10^n + 1 \equiv 0 \pmod{19}, 1 0 n + 1 0 ( m o d 53 ) . 10^n + 1 \equiv 0 \pmod{53}. The only remainders of 1 0 n 10^n modulo 53 53 are 1 , 10 , 47 , 46 , 36 , 42 , 49 , 13 , 24 , 28 , 15 , 44 , 16 1, 10, 47, 46, 36, 42, 49, 13, 24, 28, 15, 44, 16 , so there is no solution for digit sum equal to 2 2 .

We failed previously but we learned something valuable. Namely, that it's enough to investigate simple congruences modulo 19 19 and 53 53 . We notice above that 42 42 is a remainder of 1 0 n 10^n , so that 1 0 n + 11 0 ( m o d 53 ) 10^n + 11 \equiv 0 \pmod{53} does have a solution. And there is a solution modulo 19 19 as well, as 1 0 n 10^n generates all of 18 18 non-zero elements of Z / 19 Z {\bf Z} / 19 {\bf Z} .

Putting this together, there is n n such that 1 0 n + 11 10^n + 11 is divisible by both 19 19 and 53 53 and therefore also by 1007 1007 . Therefore 1 0 n + 1 + 110 10^{n+1} + 110 is divisible by 2014 2014 and the answer is 3 \bf 3 .

Can you explain in more details why the same n n could work modulo 53 53 and 19 ? 19?

Alexander Borisov - 7 years, 6 months ago

Log in to reply

Sure. We want to solve n 5 ( m o d 13 ) n \equiv 5 \pmod{13} (this is when the remainder of 1 0 n 10^n is 42 42 ) and similarly n 15 ( m o d 18 ) n \equiv 15 \pmod{18} (giving the remainder of 8 8 ). The reason these congruences appear is that the order of 10 10 is 13 13 , i.e. 1 0 13 1 ( m o d 53 ) 10^{13} \equiv 1 \pmod{53} , as an element of the multiplicative group of Z / 53 Z {\bf Z} / 53 {\bf Z} and 18 18 in mult. group of Z / 19 Z {\bf Z} / 19 {\bf Z} (this was already mentioned implicitly in terms of generation of the said group). Since 13 13 and 18 18 are coprime, it's possible to solve these congruences. Even explicitly by using Euclid's algorithm.

Marek Bernat - 7 years, 6 months ago

Log in to reply

If anyone is interested, the smallest such n = 213 = 5 + 16 13 = 15 + 11 18 n = 213 = 5 + 16 \cdot 13 = 15 + 11 \cdot 18 . So, N = 1 0 214 + 110 N = 10^{214 }+ 110 is an explicit answer to the problem. That being said, there are surely smaller examples given by 1 0 k + 1 0 l + 10 10^k + 10^l + 10 for various values of k k and l l .

Marek Bernat - 7 years, 6 months ago

Log in to reply

@Marek Bernat

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^{214}+110)

10^{235}+11\cdot 10^{22} \equiv 10+11\cdot 10^{22} \)

or 110000000000000000000010 110000000000000000000010 .

Peter Byers - 7 years, 6 months ago

what is the number N ???

Mohamed Abdalla - 7 years, 6 months ago
Souryajit Roy
May 2, 2014

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.

Louis Abraham
Apr 9, 2014

I found a solution with 5. Then I tried 4 and finally 3 !!!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...