# Direct formula derived from recursive formula

1. Feb 19, 2010

### Eider

1. The problem statement, all variables and given/known data
I have a recursive formula and I'm trying to find a direct formula.

2. Relevant equations
The recursive formula: T(n) = T(n-2) + n^2

No base is given. The question says "Assume that T(n) is constant for n <- 2

3. The attempt at a solution
T(1) = 0
difference: 4
T(2) = 4
difference: 6
T(3) = 10
difference: 8
T(4) = 18
difference: 10
T(5) = 28

So the difference is 2n, but then I get stuck and don't know how to go further and get a direct formula.

2. Feb 19, 2010

### ystael

Do you know the explicit formula for $$1 + 2 + \dots + n$$? It will help you solve this problem, and it's something you should know anyway. (Hint: fold the sequence in the middle.)

3. Feb 19, 2010

### Eider

The sum from k=0 to n of s+kv = (n+1) s + 1/2 n(n+1)v

But I don't know what to do because the difference doesn't start with 2

4. Feb 19, 2010

### ystael

Imagine it did, then correct for the problem afterward!