Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static BigInteger randomVeletlen(){
- while(true){
- int c=(int)(Math.random()*(fn.intValue()-2))+2;
- BigInteger a=BigInteger.valueOf(c);
- if(euklidesziAlg(fn,a,n).compareTo(new BigInteger("1"))==0){
- return a;
- }
- }
- }
- public static BigInteger euklidesziAlg(BigInteger a, BigInteger b, BigInteger d){
- d = a;
- if (b.intValue() != 0){
- return euklidesziAlg(b, a.mod(b), d);
- }
- return d;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement