# Thread: Recurrence relation.. does this look correct?

1. ## Recurrence relation.. does this look correct?

I have to find the recurrence relation by the sequence

a(x) = x - (-1)^x

initial conditions are x(0) = -1 x(1) = 2

A(x) - a(x-1) = x-(-1)^x – (x-1) + (-1)^x-1
A(x) = x-(-1)^x – (x-1) + (-1)^x-1 + a(x-1)
A(x) = a(x-1) – 2*(-1)^x +1

i believe I've done this correctly.. but i just wanted to make sure.. any help would be appreciated! danke

2. ## Recurrence relation

Hello JoeCrow
Originally Posted by JoeCrow
I have to find the recurrence relation by the sequence

a(x) = x - (-1)^x

initial conditions are x(0) = -1 x(1) = 2

A(x) - a(x-1) = x-(-1)^x – (x-1) + (-1)^x-1
A(x) = x-(-1)^x – (x-1) + (-1)^x-1 + a(x-1)
A(x) = a(x-1) – 2*(-1)^x +1

i believe I've done this correctly.. but i just wanted to make sure.. any help would be appreciated! danke
If I re-write your working to make it easier to read, I get:

$a_x - a_{x-1} = x-(-1)^x - (x-1) + (-1)^{x-1}$

$a_{x} = x-(-1)^x - (x-1) + (-1)^{x-1} + a_{x-1}$

$a_x = a_{x-1} - 2\cdot(-1)^x +1$

This is OK, but I'm not sure it's exactly what is wanted, because there's still a $(-1)^x$ term in the equation.

$a_{n+2} = a_n + 2, a_0 = -1, a_1 = 2$