一些数学小公式/定理的证明

定理

①:类欧几里得算法

f ( a , b , c , n ) = ∑ i = 0 n ⌊ a × i + b c ⌋ f(a,b,c,n)=\sum_{i=0}^n\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor f(a,b,c,n)=i=0nca×i+b

分类讨论
①: a ≥ c ∣ ∣ b ≥ c a\ge c||b\ge c acbc
∑ i = 0 n ⌊ a × i + b c ⌋ = ∑ i = 0 n ( ⌊ ( a % c ) i + ( b % c ) c ⌋ + i ⌊ a c ⌋ + ⌊ b c ⌋ ) \sum_{i=0}^n\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor=\sum_{i=0}^n\bigg(\bigg\lfloor\frac{(a\%c)i+(b\%c)}{c}\bigg\rfloor+i\bigg\lfloor\frac{a}{c}\bigg\rfloor+\bigg\lfloor\frac{b}{c}\bigg\rfloor\bigg) i=0nca×i+b=i=0n(c(a%c)i+(b%c)+ica+cb)
= f ( a % c , b % c , c , n ) + n × ( n + 1 ) 2 ⌊ a c ⌋ + n ⌊ b c ⌋ =f(a\%c,b\%c,c,n)+\frac{n\times(n+1)}{2}\bigg\lfloor\frac{a}{c}\bigg\rfloor+n\bigg\lfloor\frac{b}{c}\bigg\rfloor =f(a%c,b%c,c,n)+2n×(n+1)ca+ncb
②: a < c & & b < c a<c\&\&b<c a<c&&b<c

a = 0 ⇒ f ( a , b , c , n ) = 0 a=0\Rightarrow f(a,b,c,n)=0 a=0f(a,b,c,n)=0
a ≠ 0 a≠0 a=0
∑ i = 0 n ⌊ a × i + b c ⌋ = ∑ i = 0 n ∑ j = 0 ⌊ a × i + b c ⌋ − 1 1 \sum_{i=0}^n\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor=\sum_{i=0}^n\sum_{j=0}^{\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor-1}1 i=0nca×i+b=i=0nj=0ca×i+b11 = ∑ j = 0 ⌊ a ∗ n + b c ⌋ − 1 ∑ i = 0 n [ j < ⌊ a × i + b c ⌋ ] =\sum_{j=0}^{\bigg\lfloor\frac{a*n+b}{c}\bigg\rfloor-1}\sum_{i=0}^n\bigg[j<\big\lfloor\frac{a\times i+b}{c}\big\rfloor\bigg] =j=0can+b1i=0n[j<ca×i+b] = ∑ j = 0 ⌊ a ∗ n i + b c ⌋ − 1 ∑ i = 0 n [ j < ⌈ a i + b − c + 1 c ⌉ ] =\sum_{j=0}^{\bigg\lfloor\frac{a*ni+b}{c}\bigg\rfloor-1}\sum_{i=0}^n\bigg[j<\big\lceil\frac{ai+b-c+1}{c}\big\rceil\bigg] =j=0cani+b1i=0n[j<cai+bc+1] = ∑ j = 0 ⌊ a × i + b c ⌋ − 1 ∑ i = 0 n [ c j < a i + b − c + 1 ] =\sum_{j=0}^{\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor-1}\sum_{i=0}^n\bigg[cj< ai+b-c+1\bigg] =j=0ca×i+b1i=0n[cj<ai+bc+1] = ∑ j = 0 ⌊ a × i + b c ⌋ − 1 ∑ i = 0 n [ c j − b + c − 1 < a i ] =\sum_{j=0}^{\bigg\lfloor\frac{a\times i+b}{c}\bigg\rfloor-1}\sum_{i=0}^n\bigg[cj-b+c-1< ai\bigg] =j=0ca×i+b1i=0n[cjb+c1<ai] = ∑ j = 0 ⌊ a ∗ n + b c ⌋ − 1 ∑ i = 0 n [ ⌊ c j − b + c − 1 a ⌋ < i ] =\sum_{j=0}^{\bigg\lfloor\frac{a*n+b}{c}\bigg\rfloor-1}\sum_{i=0}^n\bigg[\big\lfloor\frac{cj-b+c-1}{a}\big\rfloor<i\bigg] =j=0can+b1i=0n[acjb+c1<i] = ∑ j = 0 ⌊ a ∗ n + b c ⌋ − 1 n − ⌊ c j − b + c − 1 a ⌋ =\sum_{j=0}^{\bigg\lfloor\frac{a*n+b}{c}\bigg\rfloor-1}n-\big\lfloor\frac{cj-b+c-1}{a}\big\rfloor =j=0can+b1nacjb+c1 = n ⌊ a ∗ i + b c ⌋ − f ( c , − b + c − 1 , a , ⌊ a ∗ n + b c ⌋ − 1 ) =n\bigg\lfloor\frac{a*i+b}{c}\bigg\rfloor-f(c,-b+c-1,a,\bigg\lfloor\frac{a*n+b}{c}\bigg\rfloor-1) =ncai+bf(c,b+c1,a,can+b1)
又套用①情况求解

公式

①:等比数列求和

∑ k = 1 n x k = x − x n + 1 1 − x \sum_{k=1}^nx^k=\frac{x -x^{n+1}}{1-x} k=1nxk=1xxxn+1

S n = ∑ k = 1 n x k S_n=\sum_{k=1}^nx^k Sn=k=1nxk
x × S n = x ∑ k = 1 n x k = ∑ k = 2 n + 1 x k x\times S_n=x\sum_{k=1}^nx^k=\sum_{k=2}^{n+1}x^{k} x×Sn=xk=1nxk=k=2n+1xk
两式相减即可
S n − x × S n = x 1 − x n + 1 S_n-x\times S_n=x^1-x^{n+1} Snx×Sn=x1xn+1 S n = x − x n + 1 1 − x S_n=\frac{x-x^{n+1}}{1-x} Sn=1xxxn+1

②:等差数列一次方和

首项为 a a a,公差为 d d d,求前 n n n项等差数的和
∑ i = 1 n ( a + ( i − 1 ) d ) \sum_{i=1}^n\bigg(a+(i-1)d\bigg) i=1n(a+(i1)d)

a + ( a + d ) + ( a + 2 d ) + . . . + ( a + ( n − 1 ) d ) ⏟ n = a ⋅ n + d + 2 d + . . . ( n − 1 ) d ⏟ n − 1 \underbrace{a+(a+d)+(a+2d)+...+(a+(n-1)d)}_{n}=a·n+\underbrace{d+2d+...(n-1)d}_{n-1} n a+(a+d)+(a+2d)+...+(a+(n1)d)=an+n1 d+2d+...(n1)d
= a ⋅ n + ( 1 + 2 + . . . + n − 1 ) d = a ⋅ n + n ( n − 1 ) 2 d =a·n+(1+2+...+n-1)d=a·n+\frac{n(n-1)}{2}d =an+(1+2+...+n1)d=an+2n(n1)d

③:等差数列二次方和

首项为 a a a,公差为 d d d,求前 n n n项等差数的平方的和
∑ i = 1 n ( a + ( i − 1 ) d ) 2 \sum_{i=1}^n\bigg(a+(i-1)d\bigg)^2 i=1n(a+(i1)d)2

a 2 + ( a + d ) 2 + ( a + 2 d ) 2 + . . . + ( a + ( n − 1 ) d ) 2 ⏟ n \underbrace{a^2+(a+d)^2+(a+2d)^2+...+(a+(n-1)d)^2}_{n} n a2+(a+d)2+(a+2d)2+...+(a+(n1)d)2
= a 2 + ( a 2 + 2 a d + 1 2 d 2 ) + ( a 2 + 4 a d + 2 2 d 2 ) + . . . + ( a 2 + 2 ( n − 1 ) a d + ( n − 1 ) 2 d 2 ) ⏟ n =\underbrace{a^2+(a^2+2ad+1^2d^2)+(a^2+4ad+2^2d^2)+...+(a^2+2(n-1)ad+(n-1)^2d^2)}_{n} =n a2+(a2+2ad+12d2)+(a2+4ad+22d2)+...+(a2+2(n1)ad+(n1)2d2)
= a 2 n + ( 2 a d + 4 a d + . . . + 2 ( n − 1 ) a d ) ⏟ n − 1 + ( 1 2 + 2 2 + . . . + ( n − 1 ) 2 ) d 2 ⏟ n − 1 =a^2n+\underbrace{(2ad+4ad+...+2(n-1)ad)}_{n-1}+\underbrace{(1^2+2^2+...+(n-1)^2)d^2}_{n-1} =a2n+n1 (2ad+4ad+...+2(n1)ad)+n1 (12+22+...+(n1)2)d2
= a 2 n + ( 1 + 2 + . . . + ( n − 1 ) ) 2 a d + ( n − 1 ) n ( 2 n − 1 ) 6 d 2 =a^2n+(1+2+...+(n-1))2ad+\frac{(n-1)n(2n-1)}{6}d^2 =a2n+(1+2+...+(n1))2ad+6(n1)n(2n1)d2
= a 2 n + n ( n − 1 ) a d + ( n − 1 ) n ( 2 n − 1 ) 6 d 2 =a^2n+n(n-1)ad+\frac{(n-1)n(2n-1)}{6}d^2 =a2n+n(n1)ad+6(n1)n(2n1)d2

结论

①: n & 1 = 1 ⇒ 3 ∣ ( 2 n − 2 ) n\&1=1\Rightarrow 3|(2^n-2) n&1=13(2n2)

如果 n n n奇数,有 2 n − 2 2^n-2 2n2则为 3 3 3的倍数

将减法转化为加法,如果 2 n + 1 = 3 k 2^n+1=3k 2n+1=3k成立,那么结论成立,现在来证明“如果”
分享两种方法

法1
n = 2 m + 1 n=2m+1 n=2m+1
2 n + 1 = 2 2 m + 1 + 1 = ( 2 2 m + 1 − 2 2 m − 1 ) + ( 2 2 m − 1 − 2 2 m − 3 ) + . . . + ( 2 3 − 2 1 ) + ( 2 − 1 ) 2^n+1=2^{2m+1}+1=(2^{2m+1}-2^{2m-1})+(2^{2m-1}-2^{2m-3})+...+(2^3-2^1)+(2-1) 2n+1=22m+1+1=(22m+122m1)+(22m122m3)+...+(2321)+(21)
每个括号里面的数都是 3 3 3的倍数,得证

  • 简单举例第一个括号
    2 2 m + 1 − 2 2 m − 1 = 2 2 m − 1 ∗ ( 2 2 − 1 ) = 2 2 m − 1 ∗ 3 2^{2m+1}-2^{2m-1}=2^{2m-1}*(2^2-1)=2^{2m-1}*3 22m+122m1=22m1(221)=22m13

法2:数学归纳法
n = 1 n=1 n=1时,有 2 n + 1 = 3 2^n+1=3 2n+1=3,满足条件
n = k n=k n=k时, k k k为奇,假设有 2 k + 1 = 3 t 2^k+1=3t 2k+1=3t
n = k + 2 n=k+2 n=k+2时,则有 2 n + 1 = 2 k + 2 + 1 = 4 ∗ 2 k + 1 = 4 ∗ ( 3 t − 1 ) + 1 = 12 t − 3 = 3 ∗ ( 4 t − 1 ) 2^n+1=2^{k+2}+1=4*2^k+1=4*(3t-1)+1=12t-3=3*(4t-1) 2n+1=2k+2+1=42k+1=4(3t1)+1=12t3=3(4t1)
证毕

②: 1 2 + 2 2 + . . . + n 2 = n ( n + 1 ) ( 2 n + 1 ) 6 1^2+2^2+...+n^2=\frac{n(n+1)(2n+1)}{6} 12+22+...+n2=6n(n+1)(2n+1)

( n + 1 ) 3 = n 3 + 3 n 2 + 3 n + 1 (n+1)^3=n^3+3n^2+3n+1 (n+1)3=n3+3n2+3n+1
{ 2 3 = 1 3 + 3 ∗ 1 2 + 3 ∗ 1 + 1 3 3 = 2 3 + 3 ∗ 2 2 + 3 ∗ 2 + 1 . . . n 3 = ( n − 1 ) 3 + 3 ∗ ( n − 1 ) 2 + 3 ( n − 1 ) + 1 ( n + 1 ) 3 = n 3 + 3 ∗ n 2 + 3 ∗ n + 1 \begin{cases} 2^3=1^3+3*1^2+3*1+1\\ 3^3=2^3+3*2^2+3*2+1\\ ...\\ n^3=(n-1)^3+3*(n-1)^2+3(n-1)+1\\ (n+1)^3=n^3+3*n^2+3*n+1\\ \end{cases} 23=13+312+31+133=23+322+32+1...n3=(n1)3+3(n1)2+3(n1)+1(n+1)3=n3+3n2+3n+1
等式左右两边 n n n项全加起来
( n + 1 ) 3 = 1 3 + 3 ∗ ( 1 2 + 2 2 + . . . + n 2 ) + 3 ∗ ( 1 + 2 + . . . + n ) + 1 + 1 + . . . + 1 ⏟ n (n+1)^3=1^3+3*(1^2+2^2+...+n^2)+3*(1+2+...+n)+\underbrace{1+1+...+1}_{n} (n+1)3=13+3(12+22+...+n2)+3(1+2+...+n)+n 1+1+...+1
⇔ ( 1 2 + 2 2 + . . . + n 2 ) = ( n + 1 ) 3 − 1 3 − 3 ∗ ( 1 + 2 + . . . + n ) − 1 + 1 + . . . + 1 ⏟ n 3 \Leftrightarrow (1^2+2^2+...+n^2)=\frac{(n+1)^3-1^3-3*(1+2+...+n)-\underbrace{1+1+...+1}_{n}}{3} (12+22+...+n2)=3(n+1)3133(1+2+...+n)n 1+1+...+1
⇔ ( 1 2 + 2 2 + . . . + n 2 ) = n 3 + 3 ∗ n 2 + 3 ∗ n + 1 − 1 − 3 ∗ n ( n + 1 ) 2 − n 3 \Leftrightarrow (1^2+2^2+...+n^2)=\frac{n^3+3*n^2+3*n+1-1-3*\frac{n(n+1)}{2}-n}{3} (12+22+...+n2)=3n3+3n2+3n+1132n(n+1)n
⇔ ( 1 2 + 2 2 + . . . + n 2 ) = 2 n 3 + 6 n 2 + 6 n + 2 − 2 − 3 n 2 − 3 n − 2 n 6 \Leftrightarrow (1^2+2^2+...+n^2)=\frac{2n^3+6n^2+6n+2-2-3n^2-3n-2n}{6} (12+22+...+n2)=62n3+6n2+6n+223n23n2n
⇔ ( 1 2 + 2 2 + . . . + n 2 ) = 2 n 3 + 3 n 2 + n 6 = n ( 2 n 2 + 3 n + 1 ) 6 = n ( n + 1 ) ( 2 n + 1 ) 6 \Leftrightarrow (1^2+2^2+...+n^2)=\frac{2n^3+3n^2+n}{6}=\frac{n(2n^2+3n+1)}{6}=\frac{n(n+1)(2n+1)}{6} (12+22+...+n2)=62n3+3n2+n=6n(2n2+3n+1)=6n(n+1)(2n+1)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值