## Project Euler Problem 5 Java Solution - Smallest Multiple

We can not code without having logic skills. Programming requires a lot of logic as our foundation. Fortunately, Project Euler is a good source of problems to test our skills. We will provide with solutions to problems in case we wish to test if our answer are correct. We show below the solution to Euler Problem #5 with title - Smallest Multiple.

### Project Euler Problem #5 - Smallest Multiple

For the problem number five in the Euler Project, below is how it is stated. Notice that we need to get the numerical answer. And coding is a good choice for this, rather than using mathematical analysis.
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
A simple implementation to achieve the solution is given below.
```/**
* A simple implementation to solve Euler Problem #5 - Smallest Multiple
*/
public class EulerProblemSolution {
public static void main(String[] args) {
long maxNumber = Long.MAX_VALUE;
for (int n = 21; n < maxNumber; n++) {
if (n % 20 == 0 && n % 19 == 0 && n % 17 == 0 && n % 16 == 0 && n % 13 == 0 && n % 12 == 0 && n % 11 == 0
&& n % 9 == 0 && n % 7 == 0 && n % 5 == 0 && n % 3 == 0 && n % 2 == 0) {
System.out.println(n);
break;
}
}

}
}
```

This program outputs the answer to the problem which is:

```232792560
```