def m := 3 def A := generateTensor (\x y -> match (x, y) as (integer, integer) with | (#1, _) -> 1 | ($x, #(x - 1)) -> 1 | (_, _) -> 0) [m, m] A -- [| [| 1, 1, 1 |], [| 1, 0, 0 |], [| 0, 1, 0 |] |] def B := generateTensor (\x -> if x = 1 then 1 else 0) [m] B -- [| 1, 0, 0 |] M.* A B --[| 1, 1, 0 |] M.* (M.power A 2) B --[| 2, 1, 1 |] M.* (M.power A 3) B --[| 4, 2, 1 |] M.* (M.power A 4) B --[| 7, 4, 2 |] M.* (M.power A 5) B --[| 13, 7, 4 |] M.* (M.power A 100) B --[| 180396380815100901214157639, 98079530178586034536500564, 53324762928098149064722658 |]