FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GitHub Viewer

package ProjectEuler; /** * The prime factors of 13195 are 5, 7, 13 and 29. * *

What is the largest prime factor of the number 600851475143 ? * *

Link: https://projecteuler.net/problem=3 */ public class Problem03 { /** * Checks if a number is prime or not * * @param n the number * @return {@code true} if {@code n} is prime */ public static boolean isPrime(int n) { if (n == 2) { return true; } if (n < 2 || n % 2 == 0) { return false; } for (int i = 3, limit = (int) Math.sqrt(n); i


Back | FazBrowse Home | New Git URL