Solutions
Solution 1
Define the sum as s. Since an =an+3−an+2−an+1, the sum will be:
s=a28+∑k=127(ak+3−ak+2−ak+1)s=a28+(∑k=430ak−∑k=329ak)−(∑k=228ak)s=a28+(a30−a3)−(∑k=228ak)=a28+a30−a3−(s−a1)s=−s+a28+a30
Thus s=2a28+a30, and a28,a30 are both given; the last four digits of their sum is 3668, and half of that is 1834. Therefore, the answer is 834.−
Solution 2 (bash)
Since the problem only asks for the first 28 terms and we only need to calculate mod 1000, we simply bash the first 28 terms:
a1≡1(mod1000)a2≡1(mod1000)a3≡1(mod1000)a4≡3(mod1000)a5≡5(mod1000)⋯a25≡793(mod1000)a26≡281(mod1000)a27≡233(mod1000)a28≡307(mod1000)
Adding all the residues shows the sum is congruent to 834 mod 1000.
~ I-_-I
Solution 3 (some guessing involved)/"Engineer's Induction"
All terms in the sequence are sums of previous terms, so the sum of all terms up to a certain point must be some linear combination of the first three terms. Also, we are given a28,a29, and a30, so we can guess that there is some way to use them in a formula. Namely, we guess that there exists some p,q,r such that ∑k=1nak=pan+qan+1+ran+2. From here, we list out the first few terms of the sequence and the cumulative sums, and with a little bit of substitution and algebra we see that (p,q,r)=(21,0,21), at least for the first few terms. From this, we have that ∑k=128ak=2a28+a30≡834(mod1000).
Solution by zeroman; clarified by srisainandan6
Solution 4 (if you did not know how to use the numbers given in the problem)
By the Chinese remainder theorem, each number under 1000 is uniquely determined by its mod 8 and mod 125.
We list a few terms of the sequence mod 8:
1,1,1,3,5,1,1,7,1,1,1,...
Therefore, the cycle repeats every 8 numbers, and each cycle has a sum of 4 mod 8. Therefore, the sum mod 8 is
3⋅4+1+1+1+3=2mod8.
Denote
sn=i=1∑nai.
It is easy to prove that sn+3=sn+2+sn+1+sn.
We write the sum (sn) of the first terms mod 125:
1,2,3,6,11,20,37,68,0,−20,48,28,56,7,91,29,2,−3,28,27,52,−18,61,−30,13,44,27,84.
Therefore the desired number is 84mod125.
From here, we can determine the number we are looking for is 750+84=834. -sd8