2003IMOABC,ADA,DBC,DDEACDFAB,EF,BECF,H,AFHBEG.:BGGEBF.AA{0,1,2,,29},:kAab(ab),a+b+30k.A.A{(a1,a2,,an)|aiR,i=1,2,,n},A.=(a1,a2,,an)A,=(b1,b2,,bn)A,:(,)=(|a1-b1|,|a2-b2|,,|an-bn|),D(A)={(,)|A,A}.:|D(A)||A|.f,(1)n1,f(n+1)f(n);(2)mn,(m,n)=1,f(mn)=f(m)f(n).A={1,2,,2002},M={1001,2003,3005}.AB,BM,BM-.A=A1A2,A1A2=§,A1A2M-,,(A1,A2)AM-.AM-.{xn}:x0=0,x2=32x1,x3,xn+1=134xn+34xn-1+12xn-2,n2.:?1,DDGBE,G.BG2-GE2=BD2-DE2=BD2-DF2=BF2.,BGGEBFBG.GG,AFGH.1,EF,ADEF.ADEFQ,EPBC,P,PQABR,RE.1QDPE,,QPD=QED.AFDE,,QED=FAD.,ARDP.RAQ=DAC,ARQ=ADC,,ARQADC,ARAQ=ADAC.,ARAC=AQAD=AF2=AFAE,ARAF=AEAC.,REFC,AFC=ARE.ARDP,GDPE,BGBE=BDBP=BRBA.ARGE.,AGE=ARE=AFC.,AFGH.A{3l+2|0l9}.A|A|.30,0,2,6,12,20,26.aA,2a¢0,2,6,12,20,26(mod30),a¢0,1,3,6,10,13,15,16,18,21,25,28(mod30).,AA{2,4,5,7,8,9,11,12,14,17,19,20,22,23,24,26,27,29}.10,A:{2,4},{5,7},{8,12},{11,9},{14,22},{17,19},{20},{23,27},{26,24},{29}.|A|10.|A|=10,A,,20A,29A.20A12|A,22|A,,8A,14A.,4|A,24|A,,2A,26A.29A7|A,27|A,,5A,23A.,9|A,19|A,,11A,17A.A={2,5,8,11,14,17,20,23,26,29},A.nA.A,D(A)..n=1,A={a1a2am},{0,a2-a1,a3-a1,,am-a1}AD(A).,|D(A)||A|.|A|1n1,B={(x1,x2,,xn-1)|xn(x1,x2,,xn-1,xn)A}.|D(B)||B|.bB,Ab={xn|(b,xn)A},ab=max{x|xAb},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(m-1)2log2m,kg(m)4g(m+1)mg(m)kg(m)g(3)2g(m-1)m.k+g(m)=m,f(m)=ma.f=0f(n)=na(Pn),a(a0).mnA,m+n=100120033005,mn.110002002,1000200211003,100310002002.,1,1003,1000,2002{1,1003},{1000,2002}.{2,1004},{999,2001};{3,1005},{998,2000};{500,1502},{501,1503};{1001},{1002}.A2002501,1002.,,A1,A2.,A1A2.AM-2501.n2,xn+1-32xn-132xn-1=134xn-32xn+34xn-1-132xn-1+12xn-2=-322xn+342xn-1+12xn-2=-322xn-32xn-1-132xn-2.x2-32x1-132x0=0,,xn+1=32xn+132xn-1(Pn1).2=32+132,=322344+132=322(13).x0=0xn=A322n[(1+3)n-(1-3)n].,x3=A4[(1+3)3-(1-3)3]=33A.A=x333.xn=x333322n[(1+3)n-(1-3)n].an=13[(1+3)n-(1-3)n].,{an},x3xn3|n.a3k=333[(1+3)3k-(1-3)3k]=333[(10+63)k-(10-63)k],,3|a3k.bn=(1+3)n+(1-3)n,n=0,1,2,,{bn},mn,an+m=12(anbm+ambn),bn+m=12(bnbm+3anam).m=n,a2n=anbn,b2n=12(b2n+3a2n).an=2knpn,bn=2lnqn,nknln,pnqn.a1=b1=2,k1=l1=1,k2=2,l2=3;k4=5,l4=3;k8=8,l8=5.k2m=1,m=0,2,m=1,2m-1+m+1,m2,l2m=1,m=0,3,m=1,2m-1+1,m2.m1m22,a2m1+2m2=12(a2m1b2m2+a2m2b2m1),b2m1+2m2=12(b2m1b2m2+3a2m1a2m2).k2m1+2m2=2m1-1+2m2-1+m2+1,l2m1+2m2=2m1-1+2m2-1+1.,m1m2mr2,k2m1+2m2++2mr=2m1-1+2m2-1++2mr-1+mr+1,l2m1+2m2++2mr=2m1-1+2m2-1++2mr-1+1,n=2rp,r(r2),p,kn=n2+r+1,ln=n2+1.n=4m+1,a4m+1=12(a4mb1+a1b4m)=a4m+b4m.k4m+1=2m+1.,a4m+2=12(a4mb2+b4ma2)=2(2a4m+b4m),a4m+3=12(a4mb3+b4ma3)=2(5a4m+3b4m)k4m+2=k4m+3=2m+2.kn=n2+12,n,n2+1,n2(mod4),n2+r+1,n=2rp,r2,p.3|n,xn=x332-23nan=x332kn-23npn,3|pn.k3=2=233,k6=4=236,k12=92312,k24=16=2324,,x3,x6,x12,x24.n¢0(mod4),knn2+1.,kn-23n1-n60(Pn6).n0(mod4),3|n,n=2r3kq,r2,k1,q3.,kn=2r-13kq+r+1.,kn-23n=2r-13kq+r+1-2r+13k-1q=r+1-2r-13k-1qr+1-2r-1,k=q=1.r3,2r-1=(1+1)r-1r+1.,r32r3,kq1,kn-23n0.{xn}x0,x3,x6,x12,x24.5.