▁and ▁so ▁on ▁for ▁three ▁and ▁any ▁multiple ▁of ▁three , ▁etc . ▁ ▁Therefore , ▁the ▁effort ▁can ▁be ▁reduced ▁by ▁selecting ▁only ▁prime ▁numbers ▁as ▁candidate ▁factors . ▁Furthermore , ▁the ▁trial ▁factors ▁need ▁go ▁no ▁further ▁than ▁ ▁because , ▁if ▁n ▁is ▁divis ible ▁by ▁some ▁number ▁p , ▁then ▁n ▁= ▁p ▁× ▁q ▁and ▁if ▁q ▁were ▁smaller ▁than ▁p , ▁n ▁would ▁have ▁been ▁detected ▁earlier ▁as ▁being ▁divis ible ▁by ▁q ▁or ▁by ▁a ▁prime ▁factor ▁of ▁q . ▁ ▁A ▁definite ▁bound ▁on ▁the ▁prime ▁factors ▁is ▁possible . ▁Suppose ▁Pi ▁is ▁the ▁i ''' th ▁prime , ▁so ▁that ▁P 1 ▁= ▁ 2 , ▁P 2 ▁= ▁ 3 , ▁P 3 ▁= ▁ 5 , ▁etc . ▁Then ▁the ▁last ▁prime ▁number ▁worth ▁testing ▁as ▁a ▁possible ▁factor ▁of ▁n ▁is ▁Pi ▁where ▁P 2 i   +   1 ▁> ▁n ; ▁equality ▁here ▁would ▁mean ▁that ▁Pi   +   1 ▁is ▁a ▁factor . ▁Thus , ▁testing ▁with ▁ 2 , ▁ 3 , ▁and ▁ 5 ▁suff ices ▁up ▁to ▁n ▁= ▁ 4 8 ▁not ▁just ▁ 2 5 ▁because ▁the ▁square ▁of ▁the ▁next ▁prime ▁is ▁ 4 9 , ▁and ▁below ▁n ▁= ▁ 2 5 ▁just ▁ 2 ▁and ▁ 3 ▁are ▁sufficient . ▁Should ▁the ▁square ▁root ▁of ▁n ▁be ▁integral , ▁then ▁it ▁is ▁a ▁factor ▁and ▁n ▁is ▁a ▁perfect ▁square . ▁ ▁An ▁example ▁of ▁the ▁trial ▁division ▁algorithm