gpmorales / simple-collatz-conjecture-checker- Goto Github PK
View Code? Open in Web Editor NEWUsing recursion and java, I designed a simple method that takes in any positive integer N and performs two calculations. The method returns N/2 if N is even or it returns 3*N + 1 if N is odd. This recursive process is ran until N is 1. Using a separate method called collatzChecker, I used an iterative method to call the Collatz recursive method to check if all integers leading up to N converge to 1 as well.