Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 ew Formulas for Sem-Prmes. Testg, Coutg ad Idetfcato of e ad et Sem-Prmes Issam Kaddoura, Khadja Al-Akhrass Deartmet of Maematcs, school of arts ad sceces Lebaese Iteratoal Uversty Sada, Lebao Samh Abdul-ab Deartmet of comuters ad commucatos egeerg, Lebaese Iteratoal Uversty Berut, Lebao Emal: Samh.abdulab [AT] lu.edu.lb Abstract I s aer we gve a ew semrmalty test ad we costruct a ew formula for () ( ), e fucto at couts e umber of semrmes ot eceedg a gve umber. We also reset ew formulas to detfy e semrme ad e et semrme to a gve umber. The ew formulas are based o e kowledge of e rmes less a or equal to e cube roots of : P1, P... P. Keywords-comoet; rme, semrme, semrme I. ITRODUCTIO semrme, et Securg data remas a cocer for every dvdual ad every orgazato o e globe. I telecommucato, crytograhy s oe of e studes at ermt e secure trasfer of formato [1] over e Iteret. Prme umbers have secal roertes at make em of fudametal mortace crytograhy. The core of e Iteret securty s based o rotocols, such as SSL ad TSL [] released 1994 ad ersst as e bass for securg dfferet asects of today's Iteret []. The Rvest-Shamr-Adlema ecryto meod [4], released 1978, uses asymmetrc keys for echagg data. A secret key S k ad a ublc key P k are geerated by e recet w e followg roerty: A message echered by P k ca oly be dechered by S k ad vce versa. The ublc key s ublcly trasmtted to e seder ad used to echer data at oly e recet ca decher. RSA s based o geeratg two large rme umbers, say P ad Q ad ts securty s eforced by e fact at albet e fact at e roduct of ese two rmes P Q s ublshed, t s of eormous dffculty to factorze. A semrme or ( almost rme) or (q umber) s a atural umber at s a roduct of rmes ot ecessary dstct. The semrme s eer a square of rme or square free. Also e square of ay rme umber s a semrme umber. Maematcas have bee terested may asects of e semrme umbers. I [5] auors derve a robablstc fucto g( y ) for a umber y to be semrme ad a asymtotc formula for coutg g( y ) whe y s very large. I [6] auors are terested factorzg semrmes ad use a aromato to ( ) e fucto at couts e rme umbers. Whle maematcas have acheved may mortat results cocerg dstrbuto of rme umbers, may are terested semrme roertes as to coutg rme ad semrme umbers ot eceedg a gve umber. () From [7, 8, 9], e formula for ( ) at couts e semrme umbers ot eceedg s gve by (1). P () ( ) 1 1 (1) Ths formula s based o e rmes P 1, P., Our cotrbuto s of several folds. Frst, we reset a formula to test e semrmalty of a gve teger, s formula s used to buld a ew fucto () ( ) at couts e semrmes ot eceedg a gve teger usg 1 oly P, P,... P. Secod, we reset a elct formula at detfes e semrme umber. Ad fally we gve a formula at fds e et semrme to ay gve umber. II. SEMIPRIMALITY TEST W e same comlety O( ) as e Seve of Eratosees to test a rmalty of a gve umber, we emloy e Eucldea Algorm ad e fact at every rme umber greater a has e form 6k 1 ad wout www.jct.com 49
Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 revous kowledge about ay rme, we ca test e rmalty of 8 usg e followg rocedure: Defe e followg fuctos 1 T0 ( ) 1 T1 ( ) 6 1 T ( ) 6 6 6k1 6k1 k 1 () () 6 6k1 6k1 (4) k 1 T0 T1 T T( ) Where ad are e floor ad e celg fuctos of e real umber resectvely. We have e followg eorem whch s aalog to at aeared [10] w slght modfcato ad e detals of e roof are eactly e same. (5) Theorem 1: Gve ay ostve teger 7, e 1. s rme f ad oly f T( ) 1. s comoste f ad oly f T( ) 0. For 7 7 5 6 6 (6) ( ) 4 T(6 j 7) T(6 j 5) j1 j1 couts e umber of rmes ot eceedg. ow we roof e followg Lemma: Lemma 1: If s a ostve teger w at least factors, e ere ests a rme such at: ad dvdes Proof. If has at least factors e t ca be rereseted as: a.. b c w e assumto 1 a b c, we deduce at a or a. By e fudametal eorem of armetc, a rme umber such at dvdes a. That meas a, but dvdes a ad a dvdes, hece dvdes w e roerty. Lemma 1: tells at, f s ot dvsble by ay rme, e has at most rme factors,.e., s rme or semrme. Usg e roosed rmalty test defed by T( ) we costruct e semrmalty test as follows: For 8, defe e fuctos K 1 ( ) ad K ( ) as follows: K ( ) 1 = 1 ( ) 1 (7) K ( ) = 1 1 T ( ) 1 (8) Where ( ) s e classcal rme coutg fucto reseted (6), T( ) s e same as Theorem 1. Obvously T( ) s deedet of ay revous kowledge of e rme umbers. Lemma : If K1 ( ) 0, e s dvsble by some rme. Proof. For K1 ( ) 0, we have 0 for some, e s dvsble by for some. rme Lemma : If K1 ( ) 1,e has at most rme factors eceedg. Proof. If K ( ) 1 1, e 1 for all erefore by Lemma 1:, s ot dvsble by ay eceedg., erefore has at most two rme factors Lemma 4: If T( ) 0 ad K1 ( ) 1, e s semrme ad K ( ) 0. Proof. If K 1 ( ) 1, e has at most rme factors but T( ) 0 whch meas at s comoste, hece has eactly two rme factors ad bo factors are greater a www.jct.com 50
Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 ad 1 0 erefore K ( ) 0. for each rme, Lemma 5: If T( ) 0 ad K1 ( ) 0, e s a semrme umber f ad oly f K ( ) 1. 1. T( ) 0 ad K 1 ( ) 1 or. T( ) 0, K 1 ( ) 0 ad K ( ) 1 Proof. If s semrme, e q where ad q are two rmes. If ad q bo are greater a e T( ) 0 ad q q q q 1 q 1 K1( q) 1 q ' f q where ' ad ad q' q ' are two rmes such at e T( ) 0 ad Fgure 1: MATLAB code for e comutato of K 1 ad K Proof. If T( ) 0 ad K1 ( ) 0 e dvdes a rme, but s semrme at meas q ad q s rme umber hece for rme ad q we have: q q q 1 T 1 T 1 Cosequetly, K ( ) 1 because at least oe of e terms s ot zero. Coversely, f K ( ) 1 e 1T s ot zero for some ad e q ad T 1for some q rme e T T( q) 1 hece q s a rme umber ad s a semrme umber. Fgure 1 shows e MATLAB code for e comutato of K 1 ad K. We are ow a osto to rove e followg eorem at characterzes e semrme umbers. Theorem : (Semrmalty Test): Gve ay ostve teger 7, e s semrme f ad oly f: q ' ' 1 ' q ' ' q ' K1( ' q ') 0 ' ' q ' ' 1 q ' ' ' q ' because 0 ad ' ' q ' ' 1 ' q ' ' q ' ' q ' K( ' q ') 1 T 1 ' ' ' q ' ' 1 ' q ' ' q ' ' q ' because 1 T( ) q' q' 1 T( q') 1. ' ' ' The coverse ca be roved by e same argumets. Corollary 1 A ostve teger 7 s semrme f ad oly f K ( ) K ( ) T ( ) 1. 1 Proof. A drect cosequece of e revous eorem ad lemmas. III. SEMIPRIME COUTIG FUCTIO otce at e trle ( T ( ), K1( ), K( )) have oly e followg 4 ossble cases oly: Case 1. ( T ( ), K1( ), K( )) (1,1,0) dcates at s rme umber. Case. ( T ( ), K1( ), K( )) (0,1,0) dcates at s semrme e form q where ad q are rmes at q. ad www.jct.com 51
Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 Case. ( T ( ), K1( ), K( )) (0,0,1) dcates at s semrme e form q where ad q are rmes such at ad q. Case 4. ( T ( ), K1( ), K( )) (0,0,0) dcates at has at least rme factors. Usg e revous observatos, lemmas as well as Theorem : ad corollary, we rove e followg eorem at cludes a fucto at couts all semrmes ot eceedg a gve umber. () Theorem : For 8 e, 1 (9) 8 ( ) ( K ( ) K ( ) T( )) s a fucto at couts all semrmes ot eceedg. Fgure shows e MATLAB code for comutato. Kowg at e boud of e rme s P log [11], we ca say at e P 4 log. semrme s Theorem 4: For 8 ad, s e semrme s gve by e formula: 4l 4l s 8 8 () 8 1 ( ) 8 K1( m) K( m) T ( m) m8 The formula full s gve by: 4 l s 8 m m 1 m m 1 m m m 1 T T ( m) m 8 m 1 m 1 8 where Tm ( ) s gve by T0 ( m) T1 ( m) T ( m) Tm ( ) Fgure : MATLAB code for IV. SEMIPRIME FORMULA The frst few semrmes ascedg order are s1 4, s 6, s 9, s4 10, s5 14, s6 15, s7 1, etc. We defe e fucto 1,,... ad 0,1,,... clearly G(, ) 1 1 G(, ) 1 0 where m m 6 6 1 1 m m m m 1 m m 1 m m m k1 6k 1 6k 1 m k1 6k 1 6k 1 % 6 6 Proof. For e semrme s, () ( s ) ad () () for s, ( ) ( s ) 1,,,...,. Usg e roertes of e fucto we comute 1 G(, ) 1 0 4l 4l () 8 8 G(, ( )) () 8 % 1 ( ) 8 () () 8 G(, (8)) G(, (9)) G G P G () () (, (10))... (, ( 1))... () (, ( P 1 1)) () ()... G(, ( P) G(, ( P 1)... 8 111...1 0 0 0... s where e last 1 e summato s e value of () G(, ( s 1)) ad e followed by () G(, ( s ) G(, ) 0 followed by zeroes for e rest terms of e summato, hece 4l 4l s 8 G(, ( )) 8 () 8 8 1 ( ) www.jct.com 5
Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 As a eamle, comutg e 5 semrme umber gves s5 8 111111 14 as show Table 1. (8) (9) (10) 4 (11) 4 (1) 4 (1) 4 (14) 5 G(5, (8)) 1 G(5, (9)) 1 G(5, (10)) 1 G(5, (11)) 1 G(5, (1)) 1 G(5, (1)) 1 G(5, (14)) 0 Table 1: Comutg e 5 semrme Fgure shows e MATLAB code for e comutato. semrme ow we troduce a algorm at comutes e et semrme to ay gve ostve teger. Theorem 5: If s ay ostve teger greater a 8 e e et semrme to s gve by: etsp( ) 1 1 T( ) K ( ) K ( ) 1 1 1 (10) where T ( ), K1( ), K( ) are e fuctos defed Secto. Proof. We comute e summato: 1 1 (1 T ( ) K1( ) K( )) etsp( ) 1 (1 T ( ) K1( ) K( )) 1 1 etsp( ) 1 etp( ) 1 1 etp( ) etsp( ) 1 hese (1 T ( ) K1( ) K( )) (1) (0) etsp( ) 1 (1 T( ) K1( ) K( )) 1 1 Fgure : MATLAB code for V. EXT SEMIPRIE s I our revous work [10], we troduced a formula at fds e et rme to a gve umber. I s secto, we use a ehacemet formula to fd e et rme to a gve umber ad we troduce a formula to comute e et semrme to ay gve umber. Recall at e teger 8 s a semrme umber f ad oly f K1( ) K( ) T ( ) 1 ad f s ot semrme e K1( ) K( ) T ( ) 0. () Tme secods 10 100 1000 10000 100000 1000000 10000000 100000000 4 4 99 65 78 1005 19044 174758 Table : Testg o VI. RESULTS () ( ) 0.00 0.01 0.1.0 50 1091 508840 We mlemeted e roosed fuctos usg MATLAB ad comlete e testg o a Itel Core 7-6700K w 8M cache ad a clock seed of 4.0GHz. Table shows e results related to () for some selected values of. We have also comuted few Table. semrmes as show www.jct.com 5
Iteratoal Joural of Comuter ad Iformato Techology (ISS: 79 0764) Volume 06 Issue 01, Jauary 017 s Tme secods 100 00 00 400 500 600 700 800 900 1000 5000 10000 14 669 100 155 175 098 474 866 0 595 1964 4088 0.07 0.4 0.49 0.86 1. 1.89.9.40.78 4.91 105.7 579.01 Table : Testg o semrmes Ad fally we show e et semrmes to some selected tegers Table 4. etsp( ) Tme secods 100 00 00 400 500 1000 5000 10000 106 01 01 40 501 100 5001 10001 0.01 0.0 0.04 0.07 0.09 0.1 5.9.8 Table 4: Testg o etsp( ) semrmes VII. COCLUSIO I s work, we reseted ew formulas for semrmes. Frst, () ( ) at couts e umber of semrmes ot eceedg a gve umber. Our roosed formula requres kowg oly e rmes at are less or equal whle estg formulas requre at least kowg e rmes at are less or equal. We also reset a ew formula to detfy e semrme ad fally, a ew formula at gves e et semrme to ay teger. REFERECES [1] Stadard secfcatos for ublc key crytograhy (16),. 67 89, 1998. [Ole]. Avalable: htt://grouer.eee.org/grous/16/ [] E. Rescorla, SSL ad TLS: desgg ad buldg secure systems. Addso-Wesley Readg, 001, vol. 1. [] J. Clark ad P. C. va Oorschot, Sok: Ssl ad htts: Revstg ast challeges ad evaluatg certfcate trust model ehacemets, Securty ad Prvacy (SP), 01 IEEE Symosum o. IEEE, 01,. 511 55. [4] R. L. Rvest, A. Shamr, ad L. Adlema, A meod for obtag dgtal sgatures ad ublc-key crytosystems, Commucatos of e ACM, vol. 1, o.,. 10 16, 1978. [5] S. Ishmukhametov ad F. F. Sharfulla, O a dstrubuto of semrme umbers, Izvestya Vysshkh Uchebykh Zavede. Matematka, o. 8,. 5 59, 014. [6] R. Doss, A aromato for euler h, orcetral Uversty Prescott Valley, Uted States o, 01. [7] E. W. Wesste, Semrme, Wolfram Research, Ic., 00. [8] J. H. Coway, H. Detrch, ad E. A. Bre, Coutg grous: gus, moas ad oer eotca, Ma. Itellgecer, vol. 0, o.,. 6 15, 008. [9] D. A. Goldsto, S. Graham, J. Ptz, ad C. Y. Yldrm, Small gas betwee rmes or almost rmes, Trasactos of e Amerca Maematcal Socety,. 585 50, 009. [10] I. Kaddoura ad S. Abdul-ab, O formula to comute rmes ad e rme, Aled Maematcal Sceces, vol. 6, o. 76,. 751 757, 01. [11] G. Rob, Estmato de la focto de tchebychef Ө sur le k-ème ombre remer et grades valeurs de la focto w() ombre de dvseurs remers de, Acta Armetca, vol. 4, o. 4,. 67 89, 198. www.jct.com 54