The sequence of numbers {Q(m)} is defined recursively by the following relationships:
Q(1) = 1, and:
Q(m) = 1 + Q(m/2), whenever m is ≥ 2 and even, and:
Q(m) = 1/Q(m-1), whenever m is ≥ 3 and odd.
Determine the value of d, given that Q(d) = 19/87
To find d we can build a "memory stack" of ODDs and EVENs from which we can then calculate d.
Every time we have a proper fraction we note upon the "memory stack" ODD and then take the inverse of the proper fraction to get an improper fraction. We then can convert the number into a a mixed number or a whole number.
If we get a mixed number, we add a number of EVENs to the "memory stack" equal to the value of the whole number, then subtract the whole number to leave a proper fraction at which we, again, note ODD upon our "memory stack" and repeat our processes.
If we get a whole number sans fraction, n, we end our looping and set d to an initial value of 2
(n-1). Then, reading the "memory stack" top to bottom (LIFO), we multiply d by 2 everytime we read EVEN, and increment d by 1 everytime we read ODD.
In the case where we begin with 19/87, we have the following:
19/87 ............... ODD
87/19 = 4 11/19 ..... EVEN * 4
11/19 ............... ODD
19/11 = 1 8/11 ..... EVEN
8/11 ............... ODD
11/8 = 1 3/8 ...... EVEN
3/8 ............... ODD
8/3 = 2 2/3 ...... EVEN * 2
2/3 ............... ODD
3/2 = 1 1/2 ...... EVEN
1/2 ............... ODD
2/1 = 2
Applying our algorithm we have,
d = ((((((((((2
2-1+1)*2)+1)*2
2)+1)*2)+1)*2)+1)*2
4)+1
Which calculates to
d = 1905
|
Posted by Dej Mar
on 2008-02-15 13:47:13 |