بسم الله الرحمن الرحيم[color=#0000FF]
Hello Every Body...
i have a little question about modulus
i just try to solve ard1...
but i don't know how and when to modulo the answer !!
e.g
in fibonacci sequence 0,1,1,2,3,5,8,13,21,34 ....
we can calculate the nth term of the sequence then modulo the answer
but (you know )how much bigger it's the 100term of fibo it's 22 digits ..
how to find the nth term modulo some number M without calculating the Hole Number
the question is ...
for a number like
(a+b*(c^3+d^2+e*f*g))^5 %M (for e.g.)where a,b,c,d,e,f,g are integers
can i modulo each number alone like this
((a%M+(b%M)((c%M)^3+(d%M)^2+(e%M)(f%M)*(g%M)))^5)%M;
?
Thank You ... [/color]

  • created

    Aug '12
  • last reply

    Aug '12
  • 1

    reply

  • 157

    views

  • 1

    user

Yes It Is ....
(a+b*(c^3+d^2+e*f*g))^5 %M = ((a%M+(b%M)((c%M)^3+(d%M)^2+(e%M)(f%M)*(g%M)))^5)%M;

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 13 5d

Want to read more? Browse other topics in C and C++ or view latest topics.