login
A335436
Triangle read by rows: T(n,k) = 2*n+1 for k = 0 and otherwise T(n,k) = Sum_{i=n-k..n, j=0..i-n+k, i<>n or j<>k} T(i,j).
2
1, 3, 4, 5, 8, 21, 7, 12, 35, 96, 9, 16, 49, 144, 410, 11, 20, 63, 192, 574, 1680, 13, 24, 77, 240, 738, 2240, 6692, 15, 28, 91, 288, 902, 2800, 8604, 26112, 17, 32, 105, 336, 1066, 3360, 10516, 32640, 100296, 19, 36, 119, 384, 1230, 3920, 12428, 39168, 122584, 380480
OFFSET
0,2
LINKS
FORMULA
T(n,0) = 2*n+1 for k=0;
T(n,k) = ((2+sqrt(2))^(k+1)-(2-sqrt(2))^(k+1))*(2*n-k+1)/(4*sqrt(2)) for 1<=k<=n.
EXAMPLE
Triangle begins:
1;
3, 4;
5, 8, 21;
7, 12, 35, 96;
9, 16, 49, 144, 410;
...
T(3,2) = ((2+sqrt(2))^3-(2-sqrt(2))^3)*(6-2+1)/(4*sqrt(2)) = (28*sqrt(2))*(5)/(4*sqrt(2) = 35.
MAPLE
T := proc (n, k) if k = 0 and 0 <= n then 2*n+1 elif 1 <= k and k <= n then round((((2+sqrt(2))^(k+1)-(2-sqrt(2))^(k+1))*(2*n-k+1)/(4*sqrt(2)))) else 0 end if end proc:seq(print(seq(T(n, k), k=0..n)), n=0..9);
PROG
(PARI) T(n, k) = if (k==0, 2*n+1, if (k<=n, sum(i=n-k, n, sum(j=0, i-n+k, if ((i==n) && (j==k), 0, T(i, j)), 0))));
matrix(10, 10, n, k, T(n-1, k-1)) \\ Michel Marcus, Sep 08 2020
(PARI) T(n, k) = if (k==0, 2*n+1, if (k>n, 0, my(w=quadgen(8, 'w)); ((2+w)^(k+1)-(2-w)^(k+1))*(2*n-k+1)/(4*w)));
matrix(10, 10, n, k, T(n-1, k-1)) \\ Michel Marcus, Sep 10 2020
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Oboifeng Dira, Jul 14 2020
STATUS
approved