luogu#P9825. [ICPC2020 Shanghai R] Fibonacci
[ICPC2020 Shanghai R] Fibonacci
题目描述
In mathematics, the Fibonacci numbers, commonly denoted as , is a sequence such that each number is the sum of the two preceding numbers, starting with and . That is, and .
Thus, the beginning of the sequence is .
Given , please calculate , where when is even, otherwise .
输入格式
The only line contains one integer .
输出格式
Output one number -- .
题目大意
在数学中,斐波拉契数列常被记为数列 。该数列的首项 均为 ,并满足递推公式 。
因此,数列的前一些项为 。
若 为偶数,则函数 ,否则 。求 $\sum\limits_{i=1}^n{\sum\limits_{j=i+1}^n{g(f_i,f_j)}}$ 的值。
3
2
10
24
100
2739