Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thanks, @Emil, I have computed period and length of period, as question says, how can I find fib(n) mod m using that period? and why fib(2015) mod 3 = fib(7) mod 3(for m=3 the period is 01120221 and has length 8 and 2015=251∗8+7)?
Thanks! @Igor, I had figured how to compute "period" but I have difficulties on how to use period length to get fib(n) mod m. Also, I am not able to understand the relation between fib(n) and n (as mentioned in the question I don't understand why fib(2015) mod 3 = fib(7) mod 3 ). More code-oriented question is on StackOverflow(stackoverflow.com/questions/61706899/…)