Answers for "how to calculate pisano period"

0

how to calculate pisano period

long long get_pisano_period(long long m) {
    long long a = 0, b = 1, c = a + b;
    for (int i = 0; i < m * m; i++) {
        c = (a + b) % m;
        a = b;
        b = c;
        if (a == 0 && b == 1) return i + 1;
    }
}
Posted by: Guest on July-08-2020
0

how to calculate pisano period

N = ??
n = ??
r = 0.00043
i = 0
while i <= 10:
 i = i + 1
 n = n + int(r*n*N)
 N = N - int(r*n*N)
print(n)
Posted by: Guest on April-16-2021

Browse Popular Code Answers by Language