OFFSET
1,5
LINKS
G. C. Greubel, Rows n = 1..100 of triangle, flattened
Termeszet Vilaga A XI. Természet-Tudomány Diákpályázat díjnyertesei 133.EVF. 6.SZ. jun. 2002. Vegh Lea (and Vegh Erika): Pascal-tipusu haromszogek
EXAMPLE
Triangle begins:
1;
1, 1;
1, 5, 1;
1, 13, 17, 1;
1, 29, 73, 53, 1;
1, 61, 233, 325, 161, 1;
1, 125, 649, 1349, 1297, 485, 1;
1, 253, 1673, 4645, 6641, 4861, 1457, 1;
1, 509, 4105, 14309, 27217, 29645, 17497, 4373, 1;
1, 1021, 9737, 40933, 97361, 140941, 123929, 61237, 13121, 1;
MAPLE
T:= proc(n, k) option remember;
if k=1 and k=n then 1
else 3*T(n-1, k-1) + 2*T(n-1, k)
fi
end:
seq(seq(T(n, k), k=1..n), n=1..12); # G. C. Greubel, Nov 18 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==1 || k==n, 1, 3*T[n-1, k-1] + 2*T[n-1, k]]; Table[T[n, k], {n, 10}, {k, n}]//Flatten (* G. C. Greubel, Nov 18 2019 *)
PROG
(PARI) T(n, k) = if(k==1 || k==n, 1, 3*T(n-1, k-1) + 2*T(n-1, k)); \\ G. C. Greubel, Nov 18 2019
(Magma)
function T(n, k)
if k eq 1 or k eq n then return 1;
else return 3*T(n-1, k-1) + 2*T(n-1, k);
end if;
return T;
end function;
[T(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Nov 18 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==1 or k==n): return 1
else: return 3*T(n-1, k-1) + 2*T(n-1, k)
[[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Nov 18 2019
CROSSREFS
KEYWORD
AUTHOR
Zerinvary Lajos, Jun 14 2006
EXTENSIONS
Edited by Don Reble, Jul 24 2006
STATUS
approved