Find the least positive integer n for which 2n+5n−n is a multiple of 1000.
解析
Solution 1
Recall that 1000 divides this expression if 8 and 125 both divide it. It should be fairly obvious that n≥3; so we may break up the initial condition into two sub-conditions.
(1) 5n≡n(mod8). Notice that the square of any odd integer is 1 modulo 8 (proof by plugging in 12,32,52,72 into modulo 8), so the LHS of this expression goes 5,1,5,1,…, while the RHS goes 1,2,3,4,5,6,7,8,1,…. The cycle length of the LHS is 2, RHS is 8, so the cycle length of the solution is lcm(2,8)=8. Indeed, the n that solve this congruence are exactly those such that n≡5(mod8).
(2) 2n≡n(mod125). This is extremely computationally intensive if we try to calculate all 21,22,…,2100(mod125), so we take a divide-and-conquer approach instead. In order for this expression to be true, 2n≡n(mod5) is necessary; it shouldn't take too long for us to go through the 20 possible LHS-RHS combinations, considering that n must be odd. We only need to test 10 values of n and obtain n≡3(mod20) or n≡17(mod20).
With this in mind we consider 2n≡n(mod25). By the Generalized Fermat's Little Theorem, 220≡1(mod25), but we already have n modulo 20. Our calculation is greatly simplified. The LHS's cycle length is 20 and the RHS's cycle length is 25, from which their least common multiple is 100. In this step we need to test all the numbers between 1 to 100 that n≡3(mod20) or n≡17(mod20). In the case that n≡3(mod20), the RHS goes 3,23,43,63,83, and we need 2n≡n≡23(mod25); clearly n≡83(mod100). In the case that n≡17(mod20), by a similar argument, n≡97(mod100).
In the final step, we need to calculate 297 and 283 modulo 125:
Note that 297≡2−3; because 8⋅47=376≡1(mod125), we get 297≡47(mod125).
Note that 283 is 2−17=2−16⋅2−1. We have
2−12−22−42−82−162−17≡63,≡632=3969≡−31,≡(−31)2=961≡−39,≡1521≡21,≡441,≡63⋅441≡7⋅(−31)=−217≡33.
This time, LHS cycle is 100, RHS cycle is 125, so we need to figure out n modulo 500. It should be n≡283,297(mod500).
Put everything together. By the second subcondition, the only candidates less than 1000 are 283,297,783,797. Apply the first subcondition, n=797 is the desired answer.
~Ross Gao (Solution)
~MRENTHUSIASM (Minor Reformatting)
Solution 2
We have that 2n+5n≡n(mod1000), or 2n+5n≡n(mod8) and 2n+5n≡n(mod125) by CRT. It is easy to check n<3 don't work, so we have that n≥3. Then, 2n≡0(mod8) and 5n≡0(mod125), so we just have 5n≡n(mod8) and 2n≡n(mod125). Let us consider both of these congruences separately.
First, we look at 5n≡n(mod8). By Euler's Totient Theorem (ETT), we have 54≡1(mod8), so 55≡5(mod8). On the RHS of the congruence, the possible values of n are all nonnegative integers less than 8 and on the RHS the only possible values are 5 and 1. However, for 5n to be 1(mod8) we must have n≡0(mod4), a contradiction. So, the only possible values of n are when n≡5(mod8)⟹n=8k+5.
Now we look at 2n≡n(mod125). Plugging in n=8k+5, we get 28k+5≡8k+5(mod125)⟹28k⋅32≡8k+5(mod125). Note, for 2n≡n(mod125) to be satisfied, we must have 2n≡n(mod5) and 2n≡n(mod25). Since 28k≡1(mod5) as 8k≡0(mod4), we have 2≡−2k(mod5)⟹k=5m−1. Then, n=8(5m−1)+5=40m−3. Now, we get 240m−3≡40m−3(mod125). Using the fact that 2n≡n(mod25), we get 2−3≡15m−3(mod25). The inverse of 2 modulo 25 is obviously 13, so 2−3≡133≡22(mod25), so 15m≡0(mod25)⟹m=5s. Plugging in m=5s, we get n=200s−3.
Now, we are finally ready to plug n into the congruence modulo 125. Plugging in, we get 2200s−3≡200s−3(mod125). By ETT, we get 2100≡1(mod125), so 2200s−3≡2−3≡47(mod125). Then, 200s≡50(mod125)⟹s≡4(mod5)⟹s=5y+4. Plugging this in, we get n=200(5y+4)−3=1000y+797, implying the smallest value of n is simply 797.
~rocketsri
Solution 3 (Chinese Remainder Theorem and Binomial Theorem)
We wish to find the least positive integer n for which 2n+5n−n≡0(mod1000). Rearranging gives
2n+5n≡n(mod1000).
Applying the Chinese Remainder Theorem, we get the following system of congruences:
2n+5n2n+5n≡n(mod8),≡n(mod125).
It is clear that n≥3, from which we simplify to
5n2n≡n(mod8),≡n(mod125).(1)(2)
We solve each congruence separately:
For (1), quick inspections produce that 51,52,53,54,… are congruent to 5,1,5,1,… modulo 8, respectively. More generally, 5n≡5(mod8) if n is odd, and 5n≡1(mod8) if n is even. As 5n is always odd (so is n), we must have n≡5(mod8).
That is, n=8r+5 for some nonnegative integer r.
For (2), we substitute the result from (1) and simplify:
28r+5(28)r⋅25256r⋅326r⋅32≡8r+5(mod125)≡8r+5(mod125)≡8r+5(mod125)≡8r+5(mod125).
Note that 53=125 and 6=5+1, so we apply the Binomial Theorem to the left side:
(5+1)r⋅32[(0r)50+(1r)51+(2r)52+0(mod125)(3r)53+⋯+(rr)5r]⋅32[1+5r+225r(r−1)]⋅3232+160r+400r(r−1)32+35r+25r(r−1)25r2+2r+27≡8r+5(mod125)≡8r+5(mod125)≡8r+5(mod125)≡8r+5(mod125)≡8r+5(mod125)≡0r+5(mod125).(∗)
Since 125≡0(mod5), it follows that
25r2+2r+272r+2r≡0(mod5)≡0(mod5)≡4(mod5).That is, r=5s+4 for some nonnegative integer s.
Substituting this back into (∗), we get
25(5s+4)2+2(5s+4)+27625s2+1010s+43510s+6010(s+6)s+6≡0(mod125)≡0(mod125)≡0(mod125)≡0(mod125)≡0(mod25).Therefore, the least such nonnegative integer s is 19.
Finally, combining the bolded results from above generates the least such positive integer n at s=19:
n=8r+5=8(5s+4)+5=40s+37=797.
~MRENTHUSIASM (inspired by Math Jams's 2021 AIME II Discussion)
Solution 4 (Minimal Computation)
5n≡n(mod8)
Note that 5n≡5,1,5,1,... and n≡0,..,7 so n is periodic every [2,8]=8. Easy to check that only n≡5(mod8) satisfy. Let n=8a+5. Note that by binomial theorem,
28a+5=32⋅28a≡7(1+15)2a≡7(1+30a)(mod25)
So we have 7(1+30a)≡8a+5(mod25)⟹202a≡23⟹2a≡23+25⟹a≡24(mod25). Combining a≡24(mod25) with n≡5(mod8) gives that n is in the form of 197+200k, n=197,397,597,797. Note that since ϕ(125)=100
2197+200k≡2197≡2−3≡Extended Euclidean Algorithm47(mod125)
Easy to check that only 797≡47(mod125),1797≡47(mod125),2797≡47(mod125),...
~Afo
Solution 5 (STEP by step transform)
1. The desired n has the form n=m+20l+100p, where m,l,p are integers and m<20.
Really:
(2m+20–(m+20))–(2m–m)=(2m+20–2m)–20.
The first term is a multiple of 100(Claim).
We denote step an increase in m by 20. At each step, the divisibility by 10 is preserved, the number of tens is reduced by 2.
(2m+100–(m+100))–(2m–m)=(2m+100–2m)–100.
We denote STEP an increase in m by 100. At each STEP, the first term is a multiple of 1000, which means that at each STEP the divisibility by 100 is preserved, the number of hundreds decreases by 1.
2. If the expression 2n+5n–n is a multiple of 1000, the number n is odd (2n is even, 5n is odd), which means that 5n ends in 125. Therefore, the number 2n–n ends in 875.
3. 23–3=8–3=5. The tens digit is even (0), it cannot be transformed into 7 in several steps, since at each step this digit changes by 2.
17=20–3, so 217+23 is a multiple of 10,(217–17)+(23–3)=217+23–20 is a multiple of 10.
217(mod100)=((210(mod100))⋅(27(mod100)))(mod100)=(24⋅28)(mod100)=72.(217–17)(mod100)=55.
The tens digit 5 is odd, subtracting 2 at each step in 4steps of 20 will turn it into 7. So
(297–97)(mod100)=75.297(mod1000)=((249(mod1000))⋅27)(mod1000)=672.(297–97)(mod1000)=575.
We transform 5 into 8 in 7STEPS, so
(2797–797)(mod1000)=875.(5797+2797–797)(mod1000)=0.
Note, that for n=797+1000k,k is an integer, the expression 2n+5n–n is a multiple of 1000.
Claim
The numbers 2n+2⋅5k+2n=2n(22⋅5k+1) and 2n+4⋅5k−2n=2n(24⋅5k−1)
are a multiple of 10k+1 for any n>k, where n,k are an integer.
Proof
First, if m(mod10)≡4, then (m4–m3+m2–m+1)(mod10)≡6–4+6–4+1=5.
24n+2(mod10)≡4. So, if the number 24n+2+1 is a multiple of 5k, then 220n+10+1 is a multiple of 5k+1.
The first factor is a multiple of 5k, the second factor is a multiple of 5. Their product is a multiple of 5k+1.
For odd n, using Newton's binomial for 4n, we get 22n+1 is a multiple of 5.
22n+1=4n+1=(5−1)n+1=5n−n⋅5n−1+...+5n
If n=5k, then n>k, each term is a multiple of 5n.
Therefore, the number 45k+1 is a multiple of 5k+1 and 2k+1(22⋅5k+1) is a multiple of 10k+1.
The difference
2n+4⋅5k−2n=2n(24⋅5k−1)=2n(22⋅5k−1)(22⋅5k+1)
is a multiple of 10k+1.
vladimir.shelomovskii@gmail.com, vvsss
Solution 6 (Art of Enumeration)
Problem require us to find minimum n where 2n+5n−n is a multiple of 1000.
Since we already know that multiplication does not affect mod,we can simply just focus on enumerating and hope to find some pattern.
The pattern of 5n is pretty simple, it starts with 5,25, and then repeat the pattern 125,625, in other words, 5n≡125mod1000 when n is odd, and 5n≡625mod1000 when n is even if we ignore n=1 and n=2.
The pattern of 2n, however, is quite long. In fact, it happens when n=103, where 2103≡008mod1000. More specifically, the pattern starts with n=3, which means for every 100 n, 2nmod1000 will repeat in a loop:
Moreover, we might found that for every 20 consequtive integer, 2nmod100 will repeat in a loop. Thus, by adding 5n to first twenty element, which is n=3 to n=22, we can get a pattern of last two digit of 2n+5nmod1000, which is
Noticing that only when n=3 and n=17, 2n+5n−n≡0mod10, so n=3+20k and 17+20k are our possible candidates. However, since the length of our pattern is 20, we know that n=3+20k is definetely not answer, which only left us n=17+20k.
Now, we calculate the last three digit of 2n+5n−n at n=17,n=37,n=57,n=77,n=97, which is 180,560,940,320,700.
Since the pattern will repeat for every 100 consequtive integer, the only thing that could possibly change last three digit is -n, noticing that only when n=97, 2n+5n−n≡0mod100. So the answer only could be n=97+100k2, by subtracting 700, which means adding 700 to n, we can get our final answer n=797.
Also, by this method we can ensure that 10002n+5n−n is an integer only if n=797+1000k, all the calculation can be done without a calculator (about 15 minutes or so), need some patience though.
If you are wondering, 2103=10,141,204,801,825,835,211,973,625,643,008.
~henry_in_out
Note
If you are wondering, 10002797+5797−797 is equal to the following 555-digit number: