首页 > 编程语言 > 详细

类欧几里得算法

时间:2021-06-24 22:57:15      阅读:26      评论:0      收藏:0      [点我收藏+]

\[\begin{aligned} F(a, b, c, n)&=\sum_{i=0}^n \lfloor \frac{ai+b}c\rfloor\&=\frac{n(n+1)}2\lfloor\frac ab\rfloor + (n+1)\lfloor\frac bc\rfloor+\sum_{i=0}^n\lfloor\frac{a‘i+b‘}c\rfloor\&=\frac{n(n+1)}2\lfloor\frac ab\rfloor + (n+1)\lfloor\frac bc\rfloor+\sum_{i=0}^n\sum_{j=1}^m[cj\leq a‘i+b‘]\&=\frac{n(n+1)}2\lfloor\frac ab\rfloor + (n+1)\lfloor\frac bc\rfloor+\sum_{j=1}^m[a‘i>cj-b‘-1]\&=\frac{n(n+1)}2\lfloor\frac ab\rfloor + (n+1)\lfloor\frac bc\rfloor+\sum_{j=0}^{m-1}n-\lfloor\frac{cj+c-b‘-1}a‘\rfloor\&=\frac{n(n+1)}2\lfloor\frac ab\rfloor + (n+1)\lfloor\frac bc\rfloor+nm-F(c, c-b‘-1,a, m-1) \end{aligned} \]

\[\begin{aligned} G(a,b,c,n)&=\sum_{i=0}^n[\frac{ai+b}c]^2\&=\sum_{i=0}([\frac ac]i+\frac bc+[\frac{a‘i+b‘}c])^2\&=\sum_{i=0}[\frac ac]^2i^2+2[\frac ac][\frac bc]i+2[\frac ac]i[\frac{a‘i+b‘}c]+[\frac bc]^2+2[\frac bc][\frac{a‘i+b‘}c]+[\frac{a‘i+b‘}c]^2\\end{aligned} \]

\[\begin{aligned} G(a,b,c,n)&=\sum_{i=0}^n[\frac{ai+b}c]^2\&=\sum_{i=0}^n2(\sum_{j=1}^m[cj\leq ai+b]j)-[\frac{ai+b}c]\&=\sum_{i=0}^n2(\sum_{j=0}^{m-1}[ai>cj+c-b-1](j+1))-[\frac{ai+b}c]\&=-F(a, b, c, n)+\sum_{j=0}^{m-1}2(n-[\frac {cj+c-b-1}a])(j+1)\&=-F(a, b, c, n)+m(m+1)n-2H(c, c-b-1, a, m-1)-2F(c, c-b-1, a, m-1) \end{aligned} \]

\[\begin{aligned} H(a,b,c,n)&=\sum_{i=0}^ni[\frac{ai+b}c]\&=\sum_{i=0} \end{aligned} \]

类欧几里得算法

原文:https://www.cnblogs.com/ynycoding/p/14928364.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!