1.求 a , b a,b a,b 不能组合出的最大的数,以及个数

http://acm.hdu.edu.cn/showproblem.php?pid=1792
结论:
①:不能组合出的最大数: a b a b ab-a-b abab
②:个数: ( a 1 ) ( b 1 ) 2 \frac{(a-1)(b-1)}{2} 2(a1)(b1)
没怎么看懂的证明:
http://blog.sina.com.cn/s/blog_79b832820100riqp.html
我想了一哈, a b ab ab是两个互质的数的最小公倍数,而最小公倍数的意思就是是两个的倍数,那么这个时候减一个 a a a,那肯定就不是 b b b 的倍数了,那再减一个 a a a ,那也就不是 a a a 的倍数了T_T,这样感觉很有道理哈哈哈哈,但是我不能给出严谨的证明~
至于个数为什么是那么多还没有直观的理解~

2.斐波那契数列平方和

结论:
f 2 ( 1 ) + f 2 ( 2 ) + f 2 ( 3 ) + f 2 ( 4 ) + f 2 ( 5 ) + . . . + f 2 ( n ) = f ( n ) f ( n + 1 ) f^2(1)+f^2(2)+f^2(3)+f^2(4)+f^2(5)+...+f^2(n)=f(n)*f(n+1) f2(1)+f2(2)+f2(3)+f2(4)+f2(5)+...+f2(n)=f(n)f(n+1)

3.n的阶乘在m进制下末尾0的个数

没有懂原理。。。

#include"bits/stdc++.h"
#define out(x) cout<<#x<<"="<<x
using namespace std;
typedef long long LL;
LL solve(LL n,LL m)
{
	LL res=0;
	while(n)
	{
		res+=n/m;
		n/=m;
	}
	return res;
}
int main()
{
	LL N,M;
	while(cin>>N>>M)
	{
		LL ans=1e18;
		for(LL i=2;i*i<=M;i++)
		{
			if(M%i==0)
			{
				LL cnt=0;
				while(M%i==0)M/=i,cnt++;
				ans=min(ans,solve(N,i)/cnt);
			}
		}
		cout<<ans<<endl;
	}
} 

4.格点多边形面积(皮克定理)

n 1 n_1 n1 为内部格点的数目
n 2 n_2 n2 为边上格点的数目
S = n 1 + n 2 2 1 S=n1+\frac{n_2}{2}-1 S=n1+2n21
#5.一个递推式

{ <mstyle displaystyle="true" scriptlevel="0"> a 2 n + 1 = 1 </mstyle> <mstyle displaystyle="true" scriptlevel="0"> a 2 n = a n + 1 </mstyle> \left\{ \begin{aligned}a_{2n+1}=1 \\a_{2n}=a_n+1\\ \end{aligned} \right. {a2n+1=1a2n=an+1
s u m ( n ) = n + s u m ( n 2 ) sum(n)=n+sum(\frac{n}{2}) sum(n)=n+sum(2n)