Let a10=10, and for each positive integer n>10 let an=100an−1+n. Find the least positive n>10 such that an is a multiple of 99.
解析
Solution 1
Writing out the recursive statement for an,an−1,…,a10 and summing them gives
an+⋯+a10=(an+⋯+a11)+a10=100(an−1+⋯+a10)+n+⋯+10
Which simplifies to
an=99(an−1+⋯+a10)+21(n+10)(n−9)
Therefore, an is divisible by 99 if and only if 21(n+10)(n−9) is divisible by 99, so (n+10)(n−9) needs to be divisible by 9 and 11. Since our goal is just finding the minimum n, we can do casework on whether the n+10 or n−9 is a multiple of 11 (We choose 11 because it is prime). Assume that n+10 is a multiple of 11. Writing out a few terms, n=12,23,34,45, we see that n=45 is the smallest n that works in this case. Next, assume that n−9 is a multiple of 11. Writing out a few terms, n=20,31,42,53, we see that n=53 is the smallest n that works in this case. The smallest n is 045.
Note that we can also construct the solution using CRT by assuming either 11 divides n+10 and 9 divides n−9, or 9 divides n+10 and 11 divides n−9, and taking the smaller solution. (We know this because it's impossible for both n+10 and n−9 to be divisible by 3).
Another way to get the quadratic
Writing out the first couple of terms modulo 99, we find an=an−1+n so we have a10=10,a11=21,a12=33,... We can compute their finite differences,
10,21,33,46,...11,12,13,...1,1,...
Since there are 3 rows we know it is a quadratic and we can continue, by finding the quadratic passing through (10,10),(11,21),(12,33) to get 2(n2+n−90). -mathkiddus
Solution 2 (Modular Systems and all solutions)
Hmmm... let's write our some of the terms, and convert into terms with a10, as it is the only value we know.
a11=100a10+11a12=100a11+12⇒100(100a10+11)+12a13=100a12+13⇒100(100a11+12)+13⇒100(100(100a10+11)+12)+13
Aha! We see it now! Notice that,
an=100n−10a10+(2n(n+1)−210(11))⇒an=100n−10a10+(2n(n+1)−55)⇒an=102(n−10)a10+(2n(n+1)−55)⇒an=(102(n−10))a10+(2n(n+1)−55)⇒an=(102n−19)+(2n(n+1)−55)
Yay! We need anmod99≡0mod99=0. Recall n>10, so,
(102n−19a10+(2n(n+1)−55))mod99=0
Ugh, more work :-(. Well, it suffices to check mod 9 and mod 11. Thus, we have two cases:
Case 1: mod 9
(102n−19+(2n(n+1)−55))mod9102n−19mod9+(2n(n+1)−55)mod9
in which we have an odd 10 power, so an odd 10 power results in
102n−19mod9≡1mod9=1.
Now,
2n(n+1)−55mod92n(n+1)mod9−55mod92n(n+1)mod9−1
So we have 1−1+2n(n+1)mod9=0, in which 2n(n+1)mod9=0mod9, so n(n+1)mod9=0.
Checking residues 0 - 8 class mod 9, we have either n≡0mod9 or n≡8mod9.
Case 2: mod 11
102n−19mod11 is apparent when 102n+1mod11 so we have ≡10mod11=10.
Then, 2n(n+1)−55mod11, in which 2n(n+1)mod11−55mod11, in which 2n(n+1)mod11.
We have 10+2n(n+1)mod11≡0mod11, so 2n(n+1)mod11≡−10mod11≡1mod11
So, 2n(n+1)mod11≡1mod11, in which n(n+1)mod11≡2mod11. So, checking class residuals 0-10, we see that either n≡1mod11 or n≡9mod11.
Nice! We found our solution sets! Now, using Chinese Remainder Theorem, our solutions are
A: n≡{0mod9,1mod11}
B: n≡{0mod9,9mod11}
C: n≡{8mod9,1mod11}
D: n≡{8mod9,9mod11}
In which our respective values n∈{A,B,C,D} are {45,9,89,53}. Because n>10, ¬9, and the smallest n is 045 :-).
~Pinotation
Solution 3
an≡an−1+n(mod99)
By looking at the first few terms, we can see that
an≡10+11+12+⋯+n(mod99)
This implies
an≡2n(n+1)−210∗9(mod99)
Since an≡0(mod99), we can rewrite the equivalence, and simplify
0≡2n(n+1)−210∗9(mod99)0≡n(n+1)−90(mod99)0≡4n2+4n+36(mod99)0≡(2n+1)2+35(mod99)64≡(2n+1)2(mod99)
The only squares that are congruent to 64(mod99) are (±8)2 and (±19)2, so
2n+1≡−8,8,19,or −19(mod99)2n+1≡−8(mod99) yields n=45 as the smallest integer solution.
2n+1≡8(mod99) yields n=53 as the smallest integer solution.
2n+1≡−19(mod99) yields n=89 as the smallest integer solution.
2n+1≡19(mod99) yields n=9 as the smallest integer solution. However, n must be greater than 10.
The smallest positive integer solution greater than 10 is n=045.
Solution 4 (quadratic)
Take the mods of the first few terms: a10≡10(mod99), a11≡21(mod99), a12≡33(mod99), a13≡46(mod99), etc.
Notice the pattern: We're adding 10 to the mods, then 11, then 12, and so on. So we have an≡n+an−1(mod99). Using the sum of integers formula, we can create an equation for any general an and its mod 99:
10+11+⋯+n=2n⋅(n+1)−45⟹an≡2n⋅(n+1)−45(mod99).
Let 2n⋅(n+1)−45 equal some multiple of 99 (we'll call this number 99x). We get the quadratic n2+n−(90+198x)=0. Using the quadratic formula we solve for n:
n=2−1±12−4(1)(−(90+198x))=2−1±1+360+792x=2−1±361+792x.
So now the problem becomes finding the least x such that 361+792x is a perfect square, say p2. Rearranging gives (p−19)(p+19)=792x. We can prime factorize 792 to get 23⋅32⋅11. So we need to multiply this with some number x so that two factors multiplying to 792x differ by 38. We find that the least x that works is x=10 (we can have 110⋅72=7920). Then n=2−1±91=−46,45.
~grogg007
Solution 5
an=an−1+n(mod99). Using the steps of the previous solution we get up to n2+n≡90(mod99). This gives away the fact that (n)(n+1)≡0(mod9)⟹n≡{0,8}(mod9) so either n or n+1 must be a multiple of 9.
Case 1 (9∣n): Say n=9x and after simplification x(9x+1)=10(mod90)∀x∈Z.
Case 2: (9∣n+1): Say n=9a−1 and after simplification (9a−1)(a)=10(mod90)∀a∈Z.
As a result a must be a divisor of 10 and after doing some testing in both cases the smallest value that works is x=5⟹045.
~First
Solution 5.5 (not good, risky)
We just notice that 100≡1(mod99), so we are just trying to find 10+11+12+⋯+n modulo 99, or 2n(n+1)−45 modulo 99. Also, the sum to 44 is divisible by 99, and is the first one that is. Thus, if we sum to 45 the 45 is cut off and thus is just a sum to 44.
Without checking whether there are other sums congruent to 45(mod99), we can just write the answer to be 045.
Solution 6
Let bn=2an+10. We can find a formula for bn:
bn=(20+n)(n+1).
Notice that both can't have a factor of 3. Thus we can limit our search range of n to n≡7,8(mod9). Testing values for n in our search range (like 7,8,16,17,25,26...), we get that 35 is the least n. But, don't write that down! Remember, bn=2an+10, so, the 35th term in b corresponds to the 45th term in a. Thus our answer is 045.
-AlexLikeMath
Solution 7 (slower and safer bash)
The first thing you should realize is that each term after the tenth is another two-digit number chained to the last number. 10,1011,101112,…. Now the fact that the sequence starts at 10 can be completely discarded for this solution. Just consider a(10) then same as a(1), and we can add nine to the answer at the end.
The second step is to split 99 as 9 and 11 and solve for divisibility rules individually. Let's start with 11 because it gives us the most information to continue.
In any number generated, if the numbers don't go beyond 20, then the highest number we can get is 10111213141516171819, with every odd digit being 1. This is a little risky because we are assuming that it doesn't exceed 20. If someone wanted to be absolutely sure they could continue, but this is unnecessary later and a big hassle. Anyways, now we write an equation to check for divisibility by 11. The expression being 2((n−1)+0)⋅n)−n.
The concept here is to add 0 to the n−1th term altogether, then subtract the number of ones in it, which is n. Simplify to 2n(n−3) congruent to 0(mod11). Now notice the divide by two can be discarded because one of n or (n−3) will be even. So if n or n−3 is to be divisible by 11, we can make a simple list.
n=0,3,11,14,22,25,33,36,44,47,…
Now we test each n for divisibility by 9. This is done by making a list that ultimately calculates the sum of every digit in the large number. n(1) to n(10) has the first digit 1. n(11) to n(20) has the first digit 2, and so on. The necessary thing to realize is that the sum of all digits 0−9 is divisible by 9, so we only have to solve for the sum of the first digits, and then the short list of second digits.
For example, let's test n=25.
So we know that 25 include both 1−10 and 11−20, so that's 10+20 right away. 21−25 contains 5 numbers that have the first digit 3, so +15. Then we add 0−4 together, which is 10. 10+20+15+10=55, which is not divisible by 9, so it is not the answer.
Do this for just a minute you get that 36 sums to 99, a multiple of nine! So n(36) is the answer, right? Don't forget we have to add 9 because we translated n(10) to n(1) at the very beginning! Finally, after a short bash, we get 045.
We will workmod99. The recursive formula now becomes an=an−1+n. Now, we will bash. For convenience, everything is taken mod99. The sequence is
a10a11a12a13a14a15a16a17a18a19a20a21a22a23a24a25a26a27a28a29a30a31a32a33a34a35a36a37a38a39a40a41a42a43a44a45=10=10+11=21=12+21=33=13+33=46=46+14=60=60+15=75=75+16=91=91+17=9=9+18=27=27+19=46=46+20=66=66+21=87=87+22=10=10+23=33=33+24=57=57+25=82=82+26=9=9+27=36=36+28=64=64+29=93=93+30=24=24+31=55=55+32=87=87+33=21=21+34=55=55+35=90=90+36=27=27+37=64=64+38=3=3+39=42=42+40=82=82+41=24=24+42=66=66+43=10=10+44=54=54+45=0.
Hence the least number n is n=45.
~typos fixed by lpieleanu
Solution 9
Taking the recurrence mod 99, we have
an=an−1+n
for a10=10. Then, we have
an=10+11+12+⋯+n⟹an=2n(n+1)−45≡0(mod99)⟹n(n+1)−90≡0(mod99)⟹n(n+1)+9≡0(mod99)⟹n≡0(mod9).
Then, we simply can test these values of n to find that n=045 produces a value that is also divisible by 11.
-A1001
Note
By the way, if you're wondering, a45 is the 72-digit number
101,112,131,415,161,718,192,021,222,324,252,627,282,930,313,233,343,536,373,839,404,142,434,445.
The prime factorization of a45 is
32⋅5⋅11⋅151⋅1381⋅1559⋅1,511,647⋅448,966,261,198,213,862,368,469⋅925,800,120,162,193,934,310,647,599,013
and 99a45 is the 70-digit number
Is there an efficient way to notice that the only squares that are congruent to 64(mod99) are (±8)2 and (±19)2? (In Solution 3)
Answer: Yes.
We will solve the question by looking for solutions for m∈[−49,−48,⋯,−1,0,1,⋯,48,49]. Let the square be m, thus satisfying m2−64≡0(mod99) and m2−64=(m+8)(m−8)=99k for some integer k. Checking the first factor, (m+8), for factors of 11 yields:
In the first case, the product does divide 99, so m=−8≡91 is a solution. For the others, since the first factor already divides 11, the second factor must divide 9 (or 3 in the case of m+8=33, which already has a factor of 3) in order for the product to divide 99. Here, that is not the case, so m=−8 is the only possible solution.
We immediately see that m=8 is a solution. Using a similar argument as above for the others, we notice that m=19 is the only solution in this group. Using the property that ab≡(−a)(−b)mod99, it is clear that m=−19 is also a solution. As a result, m=±8 and m=±19 are the only solutions. (This process takes a much shorter time than it seems.)