zoukankan      html  css  js  c++  java
  • Lucas定理

    定义

    对于任意质数p

    $Huge C_m^nequiv C_{iggllfloorfrac{m}{p}iggr floor}^{iggllfloorfrac{n}{p}iggr floor}*C_{m mod p}^{n mod p} (MOD p)$

    证明

    对于任意质数p都有

    $huge C_p^iequiv0 MOD p(i ot= 0&&i ot=p)$

    通过二项式定理,我们可得

    $huge (x+1)^p=sumlimits_{i=0}^pC_p^ix^i$

    因为$huge C_p^iequiv0 MOD p(i ot= 0&&i ot=p)$

    所以$huge (x+1)^pequiv x^p+1 (MOD p)$

    于是我们对于任意正整数m有

    $huge (x+1)^m=(x+1)^{iggllfloorfrac{m}{p}iggr floor*p}*(x+1)^{m mod p}equiv (x^p+1)^{iggllfloorfrac{m}{p}iggr floor}*(x+1)^{m mod p} (MOD p)$

    用二项式定理展开就是

     $huge sumlimits_{i=0}^mC_m^ix^iequiv sumlimits_{i=0}^{iggllfloorfrac{m}{p}iggr floor}C_{iggllfloorfrac{m}{p}iggr floor}^ix^{i*p}*sumlimits_{i=0}^{m mod p}C_{m mod p}^ix^i (MOD p)$

    当x指数为n的项就为,

    $huge C_m^nx^nequiv C_{iggllfloorfrac{m}{p}iggr floor}^{iggllfloorfrac{n}{p}iggr floor}x^{iggllfloorfrac{m}{p}iggr floor*p}*C_{m mod p}^{n mod p}x^{n mod p} (MOD p)$

    两边约去x的n次方就为

    $huge C_m^nequiv C_{iggllfloorfrac{m}{p}iggr floor}^{iggllfloorfrac{n}{p}iggr floor}*C_{m mod p}^{n mod p} (MOD p)$

  • 相关阅读:
    613. Shortest Distance in a Line
    182. Duplicate Emails
    181. Employees Earning More Than Their Managers
    180. Consecutive Numbers
    612. Shortest Distance in a Plane
    178. Rank Scores
    177. Nth Highest Salary
    610. Triangle Judgement
    二维气泡弹窗
    jQuery触发a标签的click事件和原生javascript的区别
  • 原文地址:https://www.cnblogs.com/bennettz/p/8080585.html
Copyright © 2011-2022 走看看