Skip to main content
Post Closed as "Not suitable for this site" by Zach Teitler, Max Alekseyev, R.P., user44191, Alex M.
formatting
Source Link
YCor
  • 63.9k
  • 5
  • 187
  • 286

For a given value of $n$ and $m$, find $\text{fib}(n) \text$ $\text{mod  } m$ where n$n$ is very huge. (Pisano Period)

Input

Integers $'n'$ (up to $10^{14}$) and $'m'$(up to $10^3$)

Output

$\text{Fib}(n)$ $\text{modulo}$ $m$

My Doubtsquestions

For Exampleexample : Why $\text{fib}(n=2015)$ $\text{mod}$ $3$ is equivalent to $\text{fib}(7) \text{mod} 3$$\text{fib}(7)$ $\text{mod } 3$? (for $𝑚 = 3$ the period is $01120221$ and has length $8$ and $2015=251*8 + 7$)

In general, after getting the remainder sequence, how  (mathematical proof) it is used for computing $\text{Fib}(n) \text{mod} m$$\text{Fib}(n)$ $\text{mod } m$?

For a given value of $n$ and $m$, find $\text{fib}(n) \text{mod} m$ where n is very huge. (Pisano Period)

Input

Integers $'n'$ (up to $10^{14}$) and $'m'$(up to $10^3$)

Output

$\text{Fib}(n)$ $\text{modulo}$ $m$

My Doubts

For Example : Why $\text{fib}(n=2015)$ $\text{mod}$ $3$ is equivalent to $\text{fib}(7) \text{mod} 3$? (for $𝑚 = 3$ the period is $01120221$ and has length $8$ and $2015=251*8 + 7$)

In general, after getting the remainder sequence, how(mathematical proof) it is used for computing $\text{Fib}(n) \text{mod} m$?

For a given value of $n$ and $m$, find $\text{fib}(n)$ $\text{mod  } m$ where $n$ is very huge. (Pisano Period)

Input

Integers $'n'$ (up to $10^{14}$) and $'m'$(up to $10^3$)

Output

$\text{Fib}(n)$ $\text{modulo}$ $m$

My questions

For example : Why $\text{fib}(n=2015)$ $\text{mod}$ $3$ is equivalent to $\text{fib}(7)$ $\text{mod } 3$? (for $𝑚 = 3$ the period is $01120221$ and has length $8$ and $2015=251*8 + 7$)

In general, after getting the remainder sequence, how  (mathematical proof) it is used for computing $\text{Fib}(n)$ $\text{mod } m$?

For a given value of n$n$ and m$m$, find fib$\text{fib}(n) mod m\text{mod} m$ where n is very huge. (Pisano Period)

Input

Integers 'n'$'n'$ (up to 10^14$10^{14}$) and 'm'$'m'$(up to 10^3$10^3$)

Output

Fib(n) modulo m$\text{Fib}(n)$ $\text{modulo}$ $m$

My Doubts

For Example : Why fib(n=2015) mod 3$\text{fib}(n=2015)$ $\text{mod}$ $3$ is equivalent to fib(7) mod 3$\text{fib}(7) \text{mod} 3$? (for 𝑚 = 3$𝑚 = 3$ the period is 01120221$01120221$ and has length 8$8$ and 2015=251*8 + 7$2015=251*8 + 7$)

In general, after getting the remainder sequence, how(mathematical proof) it is used for computing Fib(n) mod m$\text{Fib}(n) \text{mod} m$?

For a given value of n and m, find fib(n) mod m where n is very huge. (Pisano Period)

Input

Integers 'n' (up to 10^14) and 'm'(up to 10^3)

Output

Fib(n) modulo m

My Doubts

For Example : Why fib(n=2015) mod 3 is equivalent to fib(7) mod 3? (for 𝑚 = 3 the period is 01120221 and has length 8 and 2015=251*8 + 7)

In general, after getting the remainder sequence, how(mathematical proof) it is used for computing Fib(n) mod m?

For a given value of $n$ and $m$, find $\text{fib}(n) \text{mod} m$ where n is very huge. (Pisano Period)

Input

Integers $'n'$ (up to $10^{14}$) and $'m'$(up to $10^3$)

Output

$\text{Fib}(n)$ $\text{modulo}$ $m$

My Doubts

For Example : Why $\text{fib}(n=2015)$ $\text{mod}$ $3$ is equivalent to $\text{fib}(7) \text{mod} 3$? (for $𝑚 = 3$ the period is $01120221$ and has length $8$ and $2015=251*8 + 7$)

In general, after getting the remainder sequence, how(mathematical proof) it is used for computing $\text{Fib}(n) \text{mod} m$?

Source Link

For a given value of n and m, find fib(n) mod m where n is very huge. (Pisano Period)

Input

Integers 'n' (up to 10^14) and 'm'(up to 10^3)

Output

Fib(n) modulo m

My Doubts

For Example : Why fib(n=2015) mod 3 is equivalent to fib(7) mod 3? (for 𝑚 = 3 the period is 01120221 and has length 8 and 2015=251*8 + 7)

In general, after getting the remainder sequence, how(mathematical proof) it is used for computing Fib(n) mod m?