# Self referencing formula

#### uziel

##### New member
Hello, I have a tough question. I am unsure if it fits in this category; if not, I apologize.

Given three numbers, how would a future average get calculated based only on the initial three numbers and the number of periods in the future?

In the example below the first three values are the basis for all future calculations. Is this possible?

#### Harry_the_cat

##### Senior Member
Nice problem!
If the initial 3 values are a, b and c:
 Average 1 (a + b + c)/3 (a + b + c)/3 Average 2 (b + c + (a + b + c)/3)/3 (a + 4b + 4c)/9 Average 3 (c + (a+4b+4c)/9 + (a+b+c)/3)/3 (4a + 7b + 16c)/27 Average 4 (16a + 28b + 37c)/81 Average 5 (37a + 85b + 121c)/243 Average 6 (121a + 232b + 376c)/729

#### Harry_the_cat

##### Senior Member
Now it's a matter of finding a pattern in the last column.
1. The denominator is 3n.
2. The coefficients of a, b and c add up to 3n.
3. The "old" coefficient of c becomes the "new" coefficient of a.

It is also intuitive that the further down the list you go, these averages will squeeze in on one another and approach a limiting value.

So there's a start. I need to think some more. In the meantime, any ideas??

#### uziel

##### New member
Thank you for your help! What you did is very helpful, but I cannot determine a way to calculate that programmatically. For example, variable 'a' is 16 in #4 and 37 in #5. Is there a way to calculate that or must we do the math by hand?

 # a b c div 1 1 1 1 3 1,228 3 2 1 4 4 9 1,250 9 3 4 7 16 27 1,279 27 4 16 28 37 81 1,252 81 5 37 85 121 243 1,260 243 6 121 232 376 729 1,264 729

#### Harry_the_cat

##### Senior Member
Because of the way the previous 3 terms are added and then averaged (see unfinished column 2 in Post #2)

note that $$\displaystyle a_4 = 16 = 9*1 +3*1 + 1*4 = 9*a_1 +3*a_2 +1*a_3$$

Also $$\displaystyle a_5 = 37 = 9*1 +3*4 +1*16 = 9*a_2 + 3*a_3 + 1* a_4$$

This works all the way through for a, b and c

So $$\displaystyle a_n = 9*a_{n-3} + 3*a_{n-2} + 1*a_{n-1}$$

This still relies on knowing the last 3 coefficients, not just a function of n. Some more thinking needed!

#### uziel

##### New member
Actually, I think this might solve the question. I do not think you can go any further because a+b+c=div, which seems obvious now. Thank you so much!