UVa 10014 - Simple calculations

Problem Number - Problem Name

 * Uva 10014 - Simple calculations

Explanation
This problem can be solved by repeated substitution.

We are given:

An = (An-1 + An+1) / 2 - Cn

Or rearranging:

2An = An-1 + An+1 - 2Cn

We can use this to solve for An-1:

3An-1 = 2An-2 + An+1 - 2Cn - 4Cn-1

And so on:

4An-2 = 3An-3 + An+1 - 2Cn - 4Cn-1 - 6Cn-2

So at the end we get:

(n+1)A1 = nA0 + An+1 - 2Cn - 4Cn-1 - 6Cn-2 - ... - (2n)C1

Categories here, use the form, see Categories for a list