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?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3750 |
2 | Benq | 3726 |
3 | cnnfls_csy | 3690 |
4 | Radewoosh | 3649 |
5 | jiangly | 3631 |
6 | orzdevinwang | 3558 |
7 | -0.5 | 3545 |
8 | inaFSTream | 3477 |
9 | fantasy | 3468 |
10 | Rebelz | 3415 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | adamant | 178 |
2 | awoo | 167 |
3 | BledDest | 165 |
4 | Um_nik | 164 |
5 | maroonrk | 163 |
6 | SecondThread | 158 |
7 | nor | 156 |
8 | -is-this-fft- | 154 |
9 | kostka | 146 |
10 | TheScrasse | 143 |
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?
Название |
---|