[Solved] Modulo Arithmetic in Modified Geometric Progression
Note that if r is a primitive root modulo p. Then we can reduce complexity of the sum. We have to find S = a1*1 + a1*r + a1*r^2 + … + a1*r^n. Then we write S in the closed form as S = a1*(r^n – 1) / (r – 1). Now it can be … Read more