8
$\begingroup$

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?

$\endgroup$
3
  • 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
    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$ Jan 27, 2016 at 15:13
  • $\begingroup$ Perhaps, a bug. I encourage you to report your findings to Wolfram, Inc. $\endgroup$
    – bbgodfrey
    Jan 27, 2016 at 15:18

1 Answer 1

3
$\begingroup$

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.

$\endgroup$

Your Answer

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

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