# UVa 10014

## Summary

This problem can be solved by repeated substitution.

## Explanation

We are given:

${\displaystyle A_{n}=(A_{n-1}+A_{n+1})/2-C_{n}}$

Or rearranging:

${\displaystyle 2A_{n}=A_{n-1}+A_{n+1}-2C_{n}}$

We can use this to solve for An-1:

${\displaystyle 3A_{n-1}=2A_{n-2}+A_{n+1}-2C_{n}-4C_{n-1}}$

And so on:

${\displaystyle 4A_{n-2}=3A_{n-3}+A_{n+1}-2C_{n}-4C_{n-1}-6C_{n-2}}$

So at the end we get:

${\displaystyle (n+1)A_{1}=nA_{0}+A_{n+1}-2C_{n}-4C_{n-1}-6C_{n-2}-...-2nC_{1}}$