Problem 5. Smallest multiple

public class euler5 {
    public static void main(String[] args) {
	int N = 20;
	int n = N * (N-1); 
	int i = N-2;
	int number = n;
	while (i != 1) {
	    while (number % i != 0) {
	        number+=n;
	    }
	    i--;
	    n = number;
	}
	System.out.println(number);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>