Examples of MyBigInteger


Examples of info.riemannhypothesis.math.MyBigInteger

    for (BigInteger i = MyBigInteger.ZERO;
        i.compareTo(n) <= 0;
        i = i.add(MyBigInteger.ONE)) {
      product = product.multiply(prime);
      prime = new MyBigInteger(product.add(MyBigInteger.ONE)).smallestDivisor();
    }

    return prime;
  }
View Full Code Here

Examples of info.riemannhypothesis.math.MyBigInteger

    for (int i = 0;
        i <= n;
        i++) {
      product = product.multiply(prime);
      prime = new MyBigInteger(product.add(MyBigInteger.ONE)).smallestDivisor();
      primes[i] = prime;
      System.out.println("No " + i + ": " + prime.toString());
    }

    return primes;
View Full Code Here

Examples of info.riemannhypothesis.math.MyBigInteger

  /**
   * @param args
   */
  public static void main(String[] args) {
    MyBigInteger n = new MyBigInteger(100, -1, GENERATOR);
    System.out.println("Testing " + n.toString() + "...");
    long start, end;
   
    System.out.println("Regular Miller-Rabin:");
    start = System.nanoTime();
    boolean primeRegMR = isPrime(n, DEFAULT_ACCURACY);
View Full Code Here

Examples of info.riemannhypothesis.math.MyBigInteger

public class Trivial {

  public static void main(String[] args) {
//    BigInteger test = BigInteger.valueOf(12345678746529723547);
    MyBigInteger test = new MyBigInteger(60, -1000, new Random());
    System.out.println("Testing " + test.toString() + "...");

    BigInteger divisor = smallestDivisor(test);

    if (divisor == null) {
      System.out.println("Invalid input.");
View Full Code Here

Examples of info.riemannhypothesis.math.MyBigInteger

      }
    }
  }
 
  public static boolean isMersennePrime(int exponent) {
    if (exponent < 2 || ! Trivial.isPrime(new MyBigInteger(Integer.toString(exponent)))) {
      return false;
    }
   
    if (exponent == 2) {
      return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.