Problems > The K-th Hexagonal Number > Editorial

The K-th Hexagonal Number — Solution & Editorial

Back to the Problem

Apply the sequence's closed form (or index a precomputed list for Fibonacci / powers).

Complexity: O(1)

Watch out: The result approaches 1018 — 64-bit arithmetic.