Java: Prime numbers up to n -> File R/W (Programming Lab no. 11)