Euler函數(shù): m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函數(shù): 定義:phi(m) 表示小于等于m并且與m互質(zhì)的正整數(shù)的個(gè)數(shù)。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn) = p1^(r1-1)*p2^(r2-1)* …… * pn^(rn-1)*phi(p1*p2*……*pn) 定理:若(a , m) = 1 則有 a^phi(m) = 1 (mod m) 即a^phi(m) - 1 整出m 在實(shí)際代碼中可以用類(lèi)似素?cái)?shù)篩法求出 for (i = 1 i < MAXN i++) phi[i] = i for (i = 2 i < MAXN i++) if (phi[i] == i) { for (j = i j < MAXN j += i) { phi[j] /= i phi[j] *= i - 1 } } 容斥原理:定義phi(p) 為比p小的與p互素的數(shù)的個(gè)數(shù) 設(shè)n的素因子有p1, p2, p3, … pk 包含p1, p2…的個(gè)數(shù)為n/p1, n/p2… 包含p1*p2, p2*p3…的個(gè)數(shù)為n/(p1*p2)… phi(n) = n - sigm_[i = 1](n/pi) + sigm_[i!=j](n/(pi*pj)) - …… +- n/(p1*p2……pk) = n*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pk)
標(biāo)簽: Euler lt phi 函數(shù)
上傳時(shí)間: 2014-01-10
上傳用戶(hù):wkchong
1) 找出兩個(gè)相異的大素?cái)?shù)P和Q,令N=P×Q,M=(P-1)(Q-1)。 2) 找出與M互素的大數(shù)E,用歐氏算法計(jì)算出大數(shù)D,使D×E≡1 mod M。 3) 丟棄P和Q,公開(kāi)E,D和N。E和N即加密密鑰,D和N即解密密鑰。
標(biāo)簽: 大素?cái)?shù)
上傳時(shí)間: 2017-02-05
上傳用戶(hù):lhw888
加密的步驟 1) 計(jì)算N的有效位數(shù)tn(以字節(jié)數(shù)計(jì)),將最高位的零忽略掉,令tn1=tn-1。比如N=0x012A05,其有效位數(shù)tn=5,tn1=4。 2) 將明文數(shù)據(jù)A分割成tn1位(以字節(jié)數(shù)計(jì))的塊,每塊看成一個(gè)大數(shù),塊數(shù)記為bn。從而,保證了每塊都小于N。 3) 對(duì)A的每一塊Ai進(jìn)行Bi=Ai^E mod N運(yùn)算。Bi就是密文數(shù)據(jù)的一塊,將所有密文塊合并起來(lái),就得到了密文數(shù)據(jù)B。
上傳時(shí)間: 2014-12-05
上傳用戶(hù):caozhizhi
PL-SQL編程源碼,該源碼實(shí)現(xiàn)了自定義mod函數(shù)判斷質(zhì)數(shù)問(wèn)題,經(jīng)測(cè)試,結(jié)果正確。可以判斷從你輸入的兩個(gè)數(shù)之間的全部質(zhì)數(shù)并輸出。
上傳時(shí)間: 2017-02-21
上傳用戶(hù):ghostparker
IML package provides efficient routines to solve nonsingular systems of linear equations, certified solve any shape systems of linear equations, and perform mod p matrix operations, such as computing row-echelon form, determinant, rank profile, inverse of a mod p matrix.
標(biāo)簽: nonsingular efficient equations certifie
上傳時(shí)間: 2017-03-21
上傳用戶(hù):leixinzhuo
with this rar file i am sending five source codes in vhdl for xor gate,xor gate using tristae gate,electronic voting machine,mod 16 counter,jk flip flop.please accept these codes and make me member of this site.so that i can download code from this site also.i really needed codes please accept that as soon as possible.
標(biāo)簽: gate xor sending tristae
上傳時(shí)間: 2013-12-18
上傳用戶(hù):wcl168881111111
USACO 1.1.1 美國(guó)信息學(xué)奧林匹克競(jìng)賽第一題題解。 http://ace.delos.com/usacoprob2?a=tm4lT30HPme&S=ride 問(wèn)題描述 科學(xué)家們?cè)谘芯垮缧呛篌@訝地發(fā)現(xiàn),在每一個(gè)彗星后面都有一個(gè)不明飛行物UFO。 這些不明飛行物時(shí)常來(lái)帶走來(lái)自地球上的一些支持者。不幸地,他們的空間在每次旅行只能帶上一群支持者。 他們要做的是用一種聰明的方案讓某個(gè)支持彗星UFO的團(tuán)體都被彗星帶走。他們?yōu)槊總€(gè)彗星起了一個(gè)名字,通過(guò)這些名字來(lái)決定一個(gè)團(tuán)體是不是特定的彗星帶走。 那個(gè)相配方案的細(xì)節(jié)是這樣的: 所有團(tuán)體的名字和彗星的名字都以下列各項(xiàng)方式轉(zhuǎn)換成一個(gè)數(shù)字: 這個(gè)最后的數(shù)字代表名字中所有字母的信息,"A" 是 1 和 "Z" 是 26。 舉例來(lái)說(shuō),團(tuán)體 "USACO" 會(huì)是 21*19*1*3*15=17955 。 如果團(tuán)體的數(shù)字 mod 47 等于慧星的數(shù)字 mod 47,那么你要告訴這個(gè)團(tuán)體:準(zhǔn)備好行李,走吧 ! 現(xiàn)在,你要寫(xiě)一個(gè)程序來(lái)通過(guò)團(tuán)體的名字和彗星的名字來(lái)決定一個(gè)組是否應(yīng)該與在那一顆彗星后面的不明飛行物搭配。 寫(xiě)一個(gè)程序讀入彗星的名字和團(tuán)體的名字,如果搭配打印"GO"否者打印"STAY" 團(tuán)體的名字和彗星的名字將會(huì)是沒(méi)有空格或標(biāo)點(diǎn)的一串大寫(xiě)字母(不超過(guò)6個(gè)字母)。
標(biāo)簽: usacoprob USACO delos HPme
上傳時(shí)間: 2017-05-20
上傳用戶(hù):希醬大魔王
歐拉定理 對(duì)于互質(zhì)的整數(shù)a和n,有aφ(n) ≡ 1 mod n
上傳時(shí)間: 2014-01-02
上傳用戶(hù):330402686
RSA ( Rivest Shamir Adleman )is crypthograph system that used to give a secret information and digital signature . Its security based on Integer Factorization Problem (IFP). RSA uses an asymetric key. RSA was created by Rivest, Shamir, and Adleman in 1977. Every user have a pair of key, public key and private key. Public key (e) . You may choose any number for e with these requirements, 1< e <Æ (n), where Æ (n)= (p-1) (q-1) ( p and q are first-rate), gcd (e,Æ (n))=1 (gcd= greatest common divisor). Private key (d). d=(1/e) mod(Æ (n)) Encyption (C) . C=Mª mod(n), a = e (public key), n=pq Descryption (D) . D=C° mod(n), o = d (private key
標(biāo)簽: crypthograph information Adleman Rivest
上傳時(shí)間: 2017-09-01
上傳用戶(hù):chfanjiang
RANSAC (RANdom SAmple Consensus) is an iterative method to estimate parameters of a mathematical model from a set of observed data which contains outliers. Source code is in Document
標(biāo)簽: mathematical parameters Consensus iterative
上傳時(shí)間: 2017-09-09
上傳用戶(hù):a6697238
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1