Let recursion a i be defined as:
a n = a n − 1 + a n − 2 ( m o d 1 0 )
where all terms in the sequence are positive integers less than ten. For any given a 1 and a 2 , a distinct sequence is formed. For example, if a 1 = 5 and a 2 = 4 , the sequence would go 5, 4, 9, 3, 2, 5, 7, 2, 9, 1, so on and so forth. If a 6 = 6 , find the sum of all possible values of a 1 .
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.
Beautiful! Perfect.
For the sixth term of the sequence to be six, let us look at the possible fifth and fourth terms which add to give six mod ten. Here is a list:
... 9, 7, 6
... 8, 8, 6
... 7, 9, 6
... 5, 1, 6
... 4, 2, 6
... 3, 3, 6
... 2, 4, 6
... 1, 5, 6
Continuing each sequence to find the first term, we find that the only two first terms are seven and two. Thus the answer is 7 + 2 = 9 .
Cool.
Yep, this is what I did.
i guess this is the easier method although a bit rigorous... :P
sequences for first two terms will be as 7,1,8,9,7,6 and 2,8,0,8,8,6 ...and all other terms cant give sequence by any how.. so sum of 7 and 2 is 9 !!!
Noting that all the solutions already given are more elegant than this, here are a few Mathematica commands that will solve it by brute force:
a[n_] := Mod[a[n - 1] + a[n - 2], 10];
a[1] = i; a[2] = j;
Position[Table[a[6], {i, 1, 9}, {j, 1, 9}], 6]
We get only pairs with first elements 2 and 7, so the answer is 9.
After solving in few trial and error method, i found a linear Diophantine equation 3x+5y=4 ; where x is the first term and y is the second term and the solutions of the equation will give the required result.
Problem Loading...
Note Loading...
Set Loading...
Let a 1 = x and a 2 = y . Applying the recursive formula provided, we then have a 6 = n , where n ≡ 3 x + 5 y ( m o d 1 0 ) . We now have two cases:
Case 1: When y is an odd number, we have n ≡ 3 x + 5 ( m o d 1 0 ) or equivalently 3 x ≡ 1 ( m o d 1 0 ) , since we wish to have n ≡ 6 ( m o d 1 0 ) . The only possible positive integer value for x = a 1 ≤ 1 0 that fits the above equation is x = a 1 = 7
Case 2: When y is an even number, we have n ≡ 3 x ( m o d 1 0 ) or equivalently 3 x ≡ 6 ( m o d 1 0 ) , since we wish to have n ≡ 6 ( m o d 1 0 ) . The only possible positive integer value for x = a 1 ≤ 1 0 that fits the above equation is x = a 1 = 2 .
Given that the two possible values for a 1 is 2 , 7 , their sum is thus 2 + 7 = 9