@@ -0,0 +1,1071 @@
+import java.util.*;%0A%0Apublic class problem1 %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(multi_of_3_5(1000));%0A%09%09System.out.println(even_fib_num(4000000));%0A%09%09System.out.println(largest_prime_factor(600851475143L));%0A%09%7D%0A%0A%09// Find the sum of every multiple of 3 and 5 less than max%09%0A%09public static int multi_of_3_5(int max) %7B%0A%09%09int sum = 0;%0A%09%09for (int i = 0; i %3C max; i++) %7B%0A%09%09%09if (i %25 3 == 0 %7C%7C i %25 5 == 0) %7B%0A%09%09%09%09sum += i;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return sum;%0A%09%7D%0A%09%0A%09// Find the sum of even numbers in the Fibonacci sequence less than max%0A%09public static int even_fib_num(int max) %7B%0A%09%09List%3CInteger%3E l = new ArrayList%3CInteger%3E();%0A%09%09l.add(1);%0A%09%09l.add(2);%0A%09%09int i = l.get(0) + l.get(1);%0A%09%09int sum = 2;%0A%09%09while (i %3C max) %7B%0A%09%09%09l.add(i);%0A%09%09%09if (i %25 2 ==0) %7B%0A%09%09%09%09sum += i;%0A%09%09%09%7D%0A%09%09%09i = l.get(l.size() - 1) + l.get(l.size() - 2);%0A%09%09%7D%0A%09%09return sum;%0A%09%7D%0A%09%0A%09// Find the largest prime factor of a number%0A%09public static long largest_prime_factor(long num) %7B%0A%09%09int i = 2;%0A%09%09while (i * i %3C= num) %7B%0A%09%09%09if (num %25 i != 0) %7B%0A%09%09%09%09i += 1;%0A%09%09%09%7D else %7B%0A%09%09%09%09num /= i;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return num;%0A%09%7D%0A%7D%0A

solve problem 1-3 in java