I have a problem about fibonacci numbers: ==================
let f[i] be the ith fibonacci number
f[i] = 1 (1 <= i <= 2)
f[i] = f[i-1] + f[i-2] (i > 2)
how can i calculate f[f[n]] mod M (n, M <= 10^9). anyone can help me?
# | User | Rating |
---|---|---|
1 | Benq | 3783 |
2 | jiangly | 3666 |
3 | tourist | 3611 |
4 | Um_nik | 3536 |
5 | inaFSTream | 3477 |
6 | fantasy | 3468 |
7 | maroonrk | 3464 |
8 | QAQAutoMaton | 3428 |
9 | ecnerwala | 3427 |
10 | Ormlis | 3396 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 184 |
2 | adamant | 177 |
3 | awoo | 176 |
4 | nor | 169 |
5 | maroonrk | 165 |
6 | -is-this-fft- | 163 |
7 | antontrygubO_o | 152 |
8 | ko_osaga | 151 |
9 | dario2994 | 150 |
10 | SecondThread | 148 |
How can i calculate the the (nth fibonacci)th fibonacci number mod M with (n, M <= 10^9)
I have a problem about fibonacci numbers: ==================
how can i calculate f[f[n]] mod M (n, M <= 10^9). anyone can help me?
Name |
---|