Maths Olympiad Prep

Library / /505 of 740

, 2018

Number theory Difficulty 5.1 AIME, harder Find the answer United States

Problem:

A positive integer is called primer if it has a prime number of distinct prime factors. A positive integer is called primest if it has a primer number of distinct primer factors. A positive integer is called prime-minister if it has a primest number of distinct primest factors. Let NN be the smallest prime-minister number. Estimate NN.

An estimate of E>0E>0 earns 20min(NE,EN)\left\lfloor 20 \min \left(\frac{N}{E}, \frac{E}{N}\right)\right\rfloor points.

Proposed by: Yuan Yao

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Solution:

The answer is 2433537=3780002^{4} \cdot 3^{3} \cdot 5^{3} \cdot 7 = 378000.

One heuristic for estimating the answer is that numbers of the form pqrsp^{q} r^{s} for primes p,q,r,sp, q, r, s with pr,qsp \neq r, q \neq s are primest. Thus, primest numbers are not very rare, so we can expect the answer to be relatively small with only a few distinct prime factors.

A sample Python code to search for the smallest prime-minister number is as follows:

```python
from operator import *
primes = []
primers = []
primests = []
for i in range(2,3000):
prime_factors = 0
primer_factors = 0
temp = i
for x in primes:
if x > temp:
break
if temp % x == 0:
prime_factors += 1
while temp % x == 0:
temp = temp // x
if (prime_factors == 0):
primes.append(i)
continue
elif (prime_factors in primes):
primers.append(i)
for x in primers:
if i % x == 0:
primer_factors += 1
if (primer_factors in primers):
primests.append(i)

def product(L):
ans = 1
for i in L:
ans *= i
return ans

def sum_prime_product(L, curr = ()):
if (L == ()):
#print(curr)
if len(curr) in primes:
return product(curr)
return 0
return sum_prime_product(L[1:], curr + (L[0],)) + sum_prime_product(L[1:], curr)

def count_primests(L, curr = ()):
if (L == ()):
if (sum_prime_product(curr) in primers):
return 1
return 0
ans = 0
for i in range(0,L[0]+1):
ans += count_primests(L[1:], curr+(i,))
return ans

def compute(L):
ans = 1
for i in range(len(L)):
ans = (primes**L*)
return ans

def find_best(M, best = 2**20 3*5, curr = ()):
num = compute(curr)
if (num > best):
return False
if (count_primests(curr) in primests):
print(num, curr)
return num
for i in range(1,M):
result = find_best(M, best, curr + (i,))
if (result == False):
break
elif (result < best):
best = result
return best

print("Answer:", find_best(30))
```

Thus, the smallest prime-minister number is 378000378000.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.