Ashik_01's blog

By Ashik_01, history, 6 days ago, In English,

How to use the modulo operation on (n/2)*(2a+(n-1)d).I have to give the summation of the series modulo 10^9+7.Please help me.

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

»
6 days ago, # |
  Vote: I like it +9 Vote: I do not like it

(n/2)*(2a+(n-1)d) % 1000000007

problem solved

»
5 days ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

Use (a*b) mod m = ((a mod m)*(b mod m)) mod m

(a/b) mod m = ((a mod m) * (b^(-1) mod m)) mod m Modular division

»
5 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Let the summation be 's'. Then you print s % 1000000007

.