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 | 3772 |
3 | tourist | 3706 |
4 | maroonrk | 3609 |
5 | Um_nik | 3591 |
6 | fantasy | 3526 |
7 | ko_osaga | 3500 |
8 | inaFSTream | 3477 |
9 | cnnfls_csy | 3427 |
10 | zh0ukangyang | 3423 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 185 |
2 | awoo | 182 |
3 | nor | 172 |
4 | -is-this-fft- | 170 |
5 | adamant | 169 |
6 | maroonrk | 165 |
7 | antontrygubO_o | 160 |
8 | SecondThread | 158 |
9 | dario2994 | 152 |
10 | kostka | 151 |
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 |
---|