Java 8 Logical Program In Python For Prime