Prime number sequence generator; written in Java using single and multiple threads for performance comparison