English | 简体中文
This project is my personal translation and solution for the Euler Project.
This project should only be used for personal study usage. If you find any abuse, please contact me or report it.
You can find the answer below, but I extremely don't recommend you to just copy the answer.
This is a Maven project. You can find the Java solution in my code, and you can test the solution with my test cases.
Please install the Google Chrome plugin to display LaTeX or Mathjax expression correctly.
No | Title | Answer | Performance |
---|---|---|---|
1 | Multiples of 3 and 5 | 233168 | less than 10 ms |
2 | Even Fibonacci numbers | 4613732 | less than 10 ms |
3 | Largest prime factor | 6857 | less than 10 ms |
4 | Largest palindrome product | 906609 | less than 20 ms |
5 | Smallest multiple | 232792560 | less than 10 ms |
6 | Sum square difference | 25164150 | less than 10 ms |
7 | 10001st prime | 104743 | less than 5 s |
8 | Largest product in a series | 23514624000 | less than 10 ms |
9 | Special Pythagorean triplet | 31875000 | less than 10 ms |
10 | Summation of primes | 142913828922 | less than 50 ms |
11 | Largest product in a grid | 70600674 | less than 10 ms |
12 | Highly divisible triangular number | 76576500 | less than 150 ms |
13 | Large sum | 5537376230 | less than 50 ms |
14 | Longest Collatz sequence | 837799 | less than 1 s |
I am working hard on the rest problems...
In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n.
If you want to dig further more, please see Factor.
Find the smallest factor, and divide it. Just repeat that. See my implementation.
Or you can easily get the factors by Factor Calculator.
Every integer greater than 1 either is a prime number itself or can be represented as the product of prime numbers and that, moreover, this representation is unique, up to (except for) the order of the factors.
Number of factors equals each prime factor's power exponent plus 1 and multiply together. We use power exponent due to the possible composition of a factor is affected by certain prime factor's count. And we should take the condition of power exponent equals 0 into consideration, so we add 1 on the power exponents.
See Counting Factors.
A prime number (or a prime) is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.
If you want to dig further more, please see Prime Number.
Determine if the minimum factor is equal to itself. See my implementation.
A prime number generator with
- Create a list of consecutive integers from 2 through n:
$(2, 3, 4, ..., n)$ . - Initially, let p equal 2, the smallest prime number.
- Enumerate the multiples of p by counting in increments of p from 2p to n, and mark them in the list (these will be
$2p, 3p, 4p, ...$ ; the p itself should not be marked). - Find the first number greater than p in the list that is not marked. If there was no such number, stop. Otherwise, let p now equal this new number (which is the next prime), and repeat from step 3.
- When the algorithm terminates, the numbers remaining not marked in the list are all the primes below n.
See my implementation.
A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number that remains the same when its digits are reversed. Like 16461, for example, it is "symmetrical".
If you want to dig further more, please see Palindromic Number.
Determine whether the first and last Numbers are the same one by one. See my implementation.
In mathematics, the Pythagorean theorem, also known as Pythagoras' theorem, is a fundamental relation in Euclidean geometry among the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares on the other two sides. This theorem can be written as an equation relating the lengths of the sides a, b and c, often called the "Pythagorean equation":
If you want to dig further more, please see Pythagorean Theorem.