Sum of the First K Fibonacci Numbers
Using the sequence 1, 2, 3, 5, 8, ... print the sum of its first K terms.
Input: one integer K.
Output: the sum (it equals F(K+2) − 2 in this indexing).
Constraints:
- 1 ≤ K ≤ 85
Sample Tests
Input 1
4
Output 1
11
Input 2
1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.