Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to define a recurrence relation $a(n)$ which is only defined for odd n.

I tried something like: a:= (2*n-1)->a(2n-3)+(2n-2)!+a(2n-5);

which apparently doesn't work.

How do I define this properly?


share|cite|improve this question
Why not just define $b(n)=b(n-1)+(2b)!+b(n-2)$ and then $a(2n+1)=b(n)$? – Henning Makholm Nov 13 '11 at 4:07
but the problem remains, how do i define a(2n+1) = b(n)? – stefan Nov 13 '11 at 4:25
up vote 1 down vote accepted

I'll post this here because it's too much for a comment. If you use the function...

a := m -> a(m-2)+(m-1)!+a(m-4);

You have a recurrence relation defined on all integers. Is it important that your relation remains undefined for even integers?

If you try to evaluate "a(2*n-1);" Maple will complain about too many levels of recursion. This is because it needs base cases. Since the recursion is 4th order, we'll need 4 initial conditions.

If you want it to be arbitrary, you can use...





Now if you ask Maple about a(5), a(7), etc., it will unwind the recurrence. However, if you ask for a(n), it'll complain about recursion again.

What are you trying to do? Maybe a function isn't the right tool.

share|cite|improve this answer
thanks, I was hoping that i can use maple's rsovle to give me a closed expression – stefan Nov 13 '11 at 4:56
Here's the command to make Maple solve the recurrence with $a(0)=0$ and $a(2)=0$: "rsolve({a(m)=a(m-2)+(m-1)!+a(m-4),a(0)=0,a(2)=0},a(m));" [Make sure the "restart;" to wipe any previous definition of "a".] The expression it spits out isn't pretty. But then again it's not so bad it can't be worked with. – Bill Cook Nov 13 '11 at 5:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.