OFFSET
1,1
COMMENTS
EXAMPLE
The two-dimensional recurrence A(m,n) can be depicted in matrix form as
3 5 7 11 13 17 19 ...
5 13 25 43 67 97 133 ...
7 25 63 131 241 405 635 ...
11 43 131 325 697 1343 2383 ...
13 67 241 697 1719 3759 7485 ...
17 97 405 1343 3759 9237 20481 ...
19 133 635 2383 7485 20481 50199 ...
...
and then a(n) is the main diagonal of this matrix, A(n,n).
MATHEMATICA
f[1, 1]=3; f[m_, 1]:=Prime[m+1]; f[1, n_]:=Prime[n+1]; f[m_, n_]:=f[m, n]=f[m-1, n]+f[m, n-1]+f[m-1, n-1]; Table[f[n, n], {n, 25}] (* Giorgos Kalogeropoulos, Jan 03 2022 *)
PROG
(MATLAB)
clear all
close all
sz = 14
f = zeros(sz, sz);
pp = primes(50);
f(1, :) = pp(2:end);
f(:, 1) = pp(2:end);
for m=2:sz
for n=2:sz
f(m, n) = f(m-1, n-1)+f(m, n-1)+f(m-1, n);
end
end
an = []
for n=1:sz
an = [an f(n, n)];
end
S = sprintf('%i, ', an);
S = S(1:end-1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Yigit Oktar, Jan 02 2022
STATUS
approved