Solves primes-related problems and some arithmetic problems