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

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

Back to the Problem

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

Complexity: O(log N)