Training experience 12.22

Before doing a bit vjudge number theory module, do some summary
1, prime number sieve, sieve for various multiplicative function
2, s ( p n ) = 1 + p + p 2 + . . . + p n s(p^{n})=1+p+p^2+...+p^n , using geometric series summation, too s ( p n ) = ( p n + 1 1 ) p 1 s(p^n)=\frac{(p^{n+1}-1)}{p-1}
3, looking for cycles, cycle found T T then you can on T T modulo
4, g c d ( a m 1 , a n 1 ) = a g c d ( m , n ) 1 gcd(a^{m-1},a^{n-1}) = a^{gcd(m,n)}-1 promotion:
if g c d ( a , b ) = 1 gcd(a,b)=1
Ze g c d ( a m b m , a n b n ) = a g c d ( m , n ) b g c d ( m , n ) gcd(a^m-b^m,a^n-b^n) = a^{gcd(m,n)}-b^{gcd(m,n)}

Published 40 original articles · won praise 0 · Views 5133

Guess you like

Origin blog.csdn.net/edward00324258/article/details/103657596