Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigDecimal;
- public class ID3 {
- public static void main(String[] args) {
- findFactors(600851475143L);
- }
- public static void findFactors(long input){
- BigDecimal holder = BigDecimal.valueOf(input);
- for(long i = 2; i <= holder; i++){
- while(input % i == 0){
- System.out.println(input);
- input = input/i;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment