Solution 1
Denote an=23bn. Thus, for each n, we need to find smallest positive integer kn, such that
23bn=2nkn+1.
Thus, we need to find smallest kn, such that
2nkn≡−1(mod23).
Now, we find the smallest m, such that 2m≡1(mod23). By Fermat's Theorem, we must have m∣ϕ(23). That is, m∣22. We find m=11.
Therefore, for each n, we need to find smallest kn, such that
2Rem(n,11)kn≡−1(mod23).
We have the following results:
If Rem(n,11)=0, then kn=22 and bn=1.
If Rem(n,11)=1, then kn=11 and bn=1.
If Rem(n,11)=2, then kn=17 and bn=3.
If Rem(n,11)=3, then kn=20 and bn=7.
If Rem(n,11)=4, then kn=10 and bn=7.
If Rem(n,11)=5, then kn=5 and bn=7.
If Rem(n,11)=6, then kn=14 and bn=39.
If Rem(n,11)=7, then kn=7 and bn=39.
If Rem(n,11)=8, then kn=15 and bn=167.
If Rem(n,11)=9, then kn=19 and bn=423.
If Rem(n,11)=10, then kn=21 and bn=935.
Therefore, in each cycle, n∈{11l,11l+1,⋯,11l+10}, we have n=11l, 11l+3, 11l+4, 11l+6, such that bn=bn+1. That is, an=an+1. At the boundary of two consecutive cycles, b11L+10=b11(l+1).
We have 1000=90⋅11+10. Therefore, the number of feasible n is 91⋅4−1=(363) .
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Solution 2
Observe that if an−1−1 is divisible by 2n, an=an−1. If not, an=an−1+23⋅2n−1.
This encourages us to let bn=2nan−1. Rewriting the above equations, we have
bn={2bn−12bn−1+23if 2 ∣ bn−1if 2∣ bn−1
The first few values of bn are 11,17,20,10,5,14,7,15,19,21, and 22. We notice that b12=b1=11, and thus the sequence is periodic with period 11.
Note that an=an+1 if and only if bn is even. This occurs when n is congruent to 0,3,4 or 6 mod 11, giving four solutions for each period.
From 1 to 1001 (which is 91×11), there are 91×4=364 values of n. We subtract 1 from the total since 1001 satisfies the criteria but is greater than 1000 to get a final answer of 363 . ~Bxiao31415
(small changes by bobjoebilly and IraeVid13)
Solution 3 (Similar to solution 2 but more explanation)
Let an=23bn. Note that if
23bn+1≡1(mod2n+1)
Then
23bn+1≡1(mod2n)
Also
23bn≡1(mod2n)
Therefore
bn≡bn+1≡23−1(mod2n)
Then
bn+1≡bn,bn+2n(mod2n+1)
So
bn+1=bn,bn+2n
Since 0≤bn<2n and 0≤bn+1<2n+1 as an is the least positive integer multiple of 23.
Now suppose bn+1=bn. Define qn to be the quotient of 23bn divided by 2n. Then
23bn=2nqn+1 and 23bn+1=23bn=2n+1qn+1+1=2nqn+1⟹qn+1=2qn
Furthermore if quotient qn is even then
23bn=2nqn+1=2n+12qn+1
Therefore bn+1=bn if and only if qn is even. And, if this is true, then qn+1=2qn. Next, if qn is odd, we must have bn+1=bn+2n. Solving for qn+1, we have
23bn+1=2n+1qn+1+1⟹23bn+23⋅2n=2n+1qn+1+1⟹2nqn+1+23=2n+1qn+1+1⟹qn+1=2qn+1+11
Therefore, if qn is odd, qn+1=2qn+1+11. In sum, our recursion is
qn={2qn−12qn−1+1+11if 2 ∣ qn−1if 2∣ qn−1
Finally, let us list out qn to find a pattern. Because a1=23, q1=11. Through our recursion, we continue like so:
q1=11,q2=17,q2=20,q3=10,q4=5,q6=14,q7=7,q8=15,q9=19,q10=21,q11=22,q12=11,…
Therefore qn repeats with cycle length 11. Since an+1=an if and only if qn is even, in each cycle, we have 4 satisfactory values of n. There are 111000−10=90 complete cycles. There are 3 extra values in the last incomplete cycle. Therefore we obtain 90⋅4+3=363.
~CrazyVideoGamez
Solution 4 (Binary Interpretation, Computer Scientists' Playground)
We first check that gcd(23,2n)=1 hence we are always seeking a unique modular inverse of 23, bn, such that an≡23bn≡1mod2n.
Now that we know that bn is unique, we proceed to recast this problem in binary. This is convenient because xmod2n is simply the last n-bits of x in binary, and if x≡1mod2n, it means that of the last n bits of x, only the rightmost bit (henceforth 0th bit) is 1.
Also, multiplication in binary can be thought of as adding shifted copies of the multiplicand. For example:
101112×10112=101112×(10002+102+12)=101110002+1011102+101112=111111012
Now note 23=101112, and recall that our objective is to progressively zero out the n leftmost bits of an=101112×bn except for the 0th bit.
Write bn=cn−1⋯c2c1c02, we note that c0 uniquely defines the 0th bit of an, and once we determine c0, c1 uniquely determines the 1st bit of an, so on and so forth.
For example, c0=1 satisfies a1≡101112×12≡1mod102 Next, we note that the second bit of a1 is 1, so we must also have c1=1 in order to zero it out, giving
a2≡101112×112≡1011102+a1≡10001012≡012mod1002
an+1=an happens precisely when cn=0. In fact we can see this in action by working out a3. Note that a2 has 1 on the 2nd bit, so we must choose c2=1. This gives
a3≡101112×1112≡10111002+a2≡101000012≡0012mod10002
Note that since the 3rd and 4th bit are 0, c3=c4=0, and this gives a3=a4=a5.
It may seem that this process will take forever, but note that 23=101112 has 4 bits behind the leading digit, and in the worst case, the leading digits of an will have a cycle length of at most 16. In fact, we find that the cycle length is 11, and in the process found that a3=a4=a5, a6=a7, and a11=a12.
Since we have 90 complete cycles of length 11, and the last partial cycle yields a993=a994=a995 and a996=a997, we have a total of 90×4+3=363 values of n≤1000 such that an=an+1
~ cocoa @ https://www.corgillogical.com
Video Solution
https://youtu.be/ujP-V170vvI
~MathProblemSolvingSkills.com