Good morning. I would like to know if there is a way to implement memorization if there is more than one variable involved in the memorization; or more accurately, for my problem, have the memorization itself be a function of a second variable. Let me explain.

I’m working with a certain set of numbers called Hypergeometric Bernoulli Numbers (and down the road the polynomial analogues…) which are defined recursively as

$$B_{N,0}=1$$

$$B_{N,k}=-binom{N+k}{k}^{-1}sum_{j=0}^{k-1}binom{N+k}{j}B_{N,j}$$

I had a previous post here which helped me in recalling how the memorization process works in Mathematica. And it produced exactly what I needed; except I need to be able to have my resulting outputs be functions of $N$. It seems during my previous process, the $N$ is unavailable for evaluation. How can I amend my previous code to allow the memorized terms to be functions themselves?

Here was my code attempt: