My actual problem is a bit more complicated, but let us first assume that we have a recurrence relation of the following type

$a_{n,l} = a_{n-1,l} + a_{n-1,l-1} + a_{n,l-1}$

The boundary is given, let's say $a_{n,0} = n$ and $a_{0,n}=n$ for each $n\geq0$.

I would like to create a table to list the values of $a_{n,l}$. I try the following

RecurrenceTable[{a[n + 1, k + 1] == 
a[n, k] + a[n + 1, k] + a[n, k + 1], a[n, 0] == n, a[0, k] == k}, 
a, {n, 0, 6}, {k, 0, 6}] // Grid

Why does this produce the same output as input? Why can Mathematica not compute this?

  • 2
    $\begingroup$ The relevant examples in the documentation have a[n + 1, k] or a[n, k + 1], but not both, on the right side of the recurrence equation. However, I do not see why that should matter. $\endgroup$
    – bbgodfrey
    Commented Jan 27, 2016 at 14:45
  • $\begingroup$ Indeed. It feels like those examples are pretty much the only working examples. You only have to change a little bit and it breaks down... $\endgroup$ Commented Jan 27, 2016 at 15:13
  • $\begingroup$ Perhaps, a bug. I encourage you to report your findings to Wolfram, Inc. $\endgroup$
    – bbgodfrey
    Commented Jan 27, 2016 at 15:18

1 Answer 1


I figured that it can be done in an alternative way:

a[n_, k_] := a[n, k] = a[n - 1, k - 1] + a[n, k - 1] + a[n - 1, k]
a[n_, 0] := n
a[0, k_] := k
Grid[Table[a[i, j], {i, 0, 6}, {j, 0, 6}]]

Still, this does not answer the question as to why RecurrenceTable does not produce any output. I am still curious about this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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