Algorithm For Prime Number Program In Java