Number theory basics, programming and RMO training — problem set 2

1. Write a program in C, or C++, or MATLAB or Scilab or Mathematica/Maple

(a) to generate all Mersenne primes up to 2^{525}-1

(b) to determine the smallest prime number larger than 10^{100}+1.

2. Write a program that generates prime numbers up to a given number N. One can, of course, use Eratosthenes’ sieve.

3. Write a program to find four consecutive integers having the same number of factors (allowing repetitions).

4. (a) By reversing the digits of the integer 1009, we obtain the same number 9001, which is also a prime. Write a program to find the prime numbers in [1, 10000 ] verifying this property.

4(b). By reversing the digits of the prime number 163, we obtain the number 361, which is a perfect square. Using a programming language like C, C++, or even Python, (or MATLAB, or Scilab, or Mathematica/Maple), find all prime numbers p \leq 10000 with this property.

Remark: Number Theory is not taught in high schools in India. So, those who attempt RMO are especially handicapped. i have found that this experimental way or fun way of introducing/exploring number theory makes the abstract subject of Number Theory much more accessible to high school students; also, the love or programming lures every kid !!! 🙂

— Nalin Pithwa

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.