Acdreamer博客数论学习(1)Acdreamer博客数论学习Day OneDay Two
Acdreamer博客数论学习Day One等比数列求和.求解Sn=(a+a2+...+an)modMS_n = (a+a^2+...+a^n)modM采用二分.n%2==0时 Sn=(1+a(n2))Sn2 S_n = (1+a^{(\frac{n}{2})} )S_{\frac{n}{2}} ,n%2==1时,Sn=(1+an+12)Sn−12+an+12S_n = (1+a^{\frac{n