Problems > Sequence f=5a+2b > Editorial

Sequence f=5a+2b — Solution & Editorial

Back to the Problem

Exponentiate the 2×2 companion matrix [[5, 2], [1, 0]] in O(log N).

Complexity: O(log N)