经过两天的努力 终于把AC大神的课件都看完了 感动啊啊啊TAT 顿时感觉智力上升了一个层次 之后看到数论的题目终于可以不用放弃治疗了~~~ 我会说我刚刚用了十分钟就把欧拉函数看完了吗~~~(其实之前就会-。-)
欧拉函数也就是phi(n) 表示小于等于n的且与n互质的数的个数
欧拉函数的公式是 phi(n)=n*(1-1/p1)*(1-1/p2)*…*(1-1/pn)
要证明这个公式 我们需要先证明一些简单的性质
1.若p为素数 phi(p)=p-1
小于某个素数的数都和这个素数互质- – 显然
2.phi(p^k)=(p-1)*p^(k-1)
小于等于p^k的数中不与p互质的数肯定都是p的倍数
这些数有p^k/p=p^(k-1)个 而总共有p^k个数
所以phi(p^k)=p^k-p(k-1)=(p-1)*p^(k-1)
3.若(a,b)=1 phi(a*b)=phi(a)*phi(b)
AC大神因为欧拉函数是积性函数0 0? 我也不懂为什么- -…
4.若p|a 则phi(p*a)=phi(a)*p
设 a=a’*p^k ((a’,p)=1)
phi(p^k)*p
=(p-1)*p^(k-1)*p
=(p-1)*p^k
=phi(p^(k+1))
phi(a)*p
=phi(a’)*phi(p^k)*p
=phi(a’)*phi(p^(k+1))
=phi(a*p)
综上所述
phi(n)
=phi(p1^a1*p2^a2*…*pn^an)
=phi(p1^a1)*phi(p2^a2)*…*phi(pn^an)
=((p1-1)*p1^(a1-1))*((p2-1)*p2^(a2-1))*…*((pn-1)*pn^(an-1))
=(p1^a1*p2^a2*…*pn^an)*((p1-1)*(p2-1)*…*(pn-1))/(p1*p2*…*pn)
=n*(1-1/p1)*(1-1/p2)*…*(1-1/pn)
得证!
顺便扯些关于欧拉函数的东西- –
欧拉定理:
若(a,n)=1 a^phi(n)=1(mod n)
费马小定理:
当n为质数且(a,n)=1时 a^(n-1)=1(mod n)
费马小定理推论:
这时a的乘法逆元为a^(n-2)
O(n)求欧拉函数代码:


1 void makepri(){ 2 for (ll i=2;i<=N;i++){ 3 if (!bo[i]){ 4 pri[++pri[0]]=i; 5 phi[i]=i-1; 6 } 7 for (ll j=1;j<=pri[0] && i*pri[j]<=N;j++){ 8 bo[i*pri[j]]=1; 9 if (i%pri[j]) phi[i*pri[j]]=phi[i]*(pri[j]-1); 10 else{ 11 phi[i*pri[j]]=phi[i]*pri[j]; 12 break; 13 } 14 } 15 } 16 }
View Code
how to get viagra in india viagra online quick delivery buy viagra 100mg online uk
cephalexin 500mg capsule lup does cephalexin cover staph what is another name for keflex
does keflex upset your stomach skin cellulitis keflex bactrum cephalexin and propranolol
what is cephalexin used for dogs does keflex cause diarrhea which is stronger cephalexin or amoxicillin
cephalexin for dogs eye infection cefazolin vs cephalexin does cephalexin treat gonorrhea and chlamydia
cephalexin antibiotics for dogs does cephalexin cause gas cephalexin 500mg while pregnant
cephalexin 500mg dog can cephalexin and amoxicillin be taken together cephalexin 250 5ml
cephalexin used for ear infections can you uses keflex with sunburn if allergic to penicillin can you take keflex
can you drink on amoxicillin clav how long does it take for strep throat to go away with amoxicillin can you take amoxicillin and sulfamethoxazole together
will amoxicillin treat trichomoniasis how long after taking amoxicillin can i drink coffee amoxicillin before or after food
augmentin 1g/200mg vidal augmentin not working for ear infection aktil duo augmentin duo
amoxicillin vs keflex how long can amoxicillin be out of the fridge amoxicillin clavulanate 875-125
amoxicillin with potassium amoxicillin nausea do you need to take amoxicillin with food
can i take tylenol with amoxicillin amoxicillin interactions difference between amoxicillin and azithromycin
ciprofloxacin fish ciprofloxacin ophthalmic solution 0.3 for eyes can i eat oatmeal with ciprofloxacin
accidentally took ibuprofen with prednisone prednisone generic name prednisone tastes awful
what’s doxycycline used for side effects of doxycycline doxycycline dosage for dogs by weight kg
doxycycline for stds dosage how long does it take doxycycline to work for uti doxycycline for dogs dosage chart
caffeine and ciprofloxacin sandoz ciprofloxacin augmentin vs ciprofloxacin
can you take mucinex and prednisone prednisone tinnitus success prednisone 20 mg for cough dosage
prednisone side effects diarrhea how to relax on prednisone gabapentin and prednisone
cephalexin 500 mg capsule side effects cephalexin in pregnancy dose cephalexin take with food
brand name viagra online viagra no prescription sildenafil 25 mg daily
cialis price walgreens canadian pharmacy no prescription generic cialis tadalafil bulk powder
cialis .uk soft cialis canadian pharmacy how much is cialis in canada
viagra online order in india online viagra cheap viagra generic without prescription
where to buy viagra online australia 150 mg viagra for sale how much is 1 viagra pill
windsor, ontario, canada pharmacy cialis cialis time review of cialis
how to start an essay example cheap essay writer sat essay score
essay helper write my law essay help writing argumentative essay
help writing scholarship essays essays writing service best college essay writing service
informative essay examples write my essay reviews argumentative essay definition
how to write my college essay best website to get essays buy college essays
can someone write my essay for me essay title page i need help writing an essay for college
essay writing service best how to write an essay in apa format ways to start an essay
remote consultation online pharmacy best online pharmacy tramadol online pharmacies
domperidone new zealand pharmacy online pharmacy reviews 2018 atorvastatin online pharmacy
valium online us pharmacy pharmacy review tramadol famvir online pharmacy
Sporanox texas board of pharmacy internet viagra pharmacy
lortab online pharmacy online pharmacy paroxetine wellbutrin sr online pharmacy
how long does it take for tadalafil to take effect pregnancy category for tadalafil tadalafil plus ambrisentan
tadalafil and sildenafil difference is 5 mg tadalafil enough dapoxetine tadalafil
can you drink with tadalafil cheapest tadalafil 20 mg tadalafil 50 mg
tadalafil white pill can you take tadalafil and tamsulosin together tadalafil para que sirve
tadalafil sublingual dosage how long do tadalafil side effects last how to spot fake tadalafil
tadalafil under tongue cost of generic tadalafil tadalafil and diabetes
tadalafil price insurance prescription for tadalafil how long does 20 mg of tadalafil last
extreme peptides tadalafil tadalafil cocaine “30” mg tadalafil 5mg uses
dr reddy tadalafil reviews tadalafil cancer what drugs may have effect on tadalafil
tadalafil 30mg liquid dosage chrisale tadalafil daily tadalafil
tadalafil 9 mg how long does tadalafil 9mg last how to take tadalafil 20mg tablets
cheapest tadalafil 20 mg which is better tadalafil or vardenafil price of tadalafil
when to take tadalafil 10mg why doesn’t tadalafil work tadalafil and amlodipine
tadalafil generic availability modula tadalafil reviews tamsulosin and tadalafil
daily tadalafil reviews does tadalafil show up on a drug test is tadalafil chewable
daily tadalafil benefits tadalafil aumenta a testosterona tadalafil dosage liquid
can tadalafil cause gout potenzmittel tadalafil erfahrungen is tadalafil like viagra