# 2007 iTest Problems/Problem 44

## Problem

A positive integer $n$ between $1$ and $N=2007^{2007}$ inclusive is selected at random. If $a$ and $b$ are natural numbers such that $a/b$ is the probability that $N$ and $n^3-36n$ are relatively prime, find the value of $a+b$.

## Solution

Factoring $2007^{2007}$ results in $3^{4014} \cdot 223^{2007}$, and factoring $n^3 - 36n$ results in $n(n+6)(n-6)$. In order for $N$ and $n^3 - 36n$ to be relatively prime, then $n^3 - 36n$ can not have multiples of $3$ or $223$, and $n$ can not be $6$ away from a multiple of $223$, so use complementary counting.

There are $\frac{2007^{2007}}{3}$ numbers in the range that are a multiple of $3$, and there are $3 \cdot \frac{2007^{2007}}{223} - 1$ numbers from $1$ to $2007^{2007}$ that are multiples of $223$ or $6$ away from a multiple of $223$. However, there are $3 \cdot \frac{2007^{2007}}{669} - 1$ numbers that are a multiple of $3$ and a multiple of $223$ or six away from a multiple of $223$. Using PIE, there are a total of $\frac{229}{669} \cdot 2007^{2007}$ values of $n$ that do not work.

That means the number of values of $n$ that work is $\frac{440}{669} \cdot 2007^{2007}$, and since a number is picked at random from $2007^{2007}$ values, the probability that $N$ and $n^3 - 36n$ are relatively prime is $\frac{440}{669}$. Thus, $a+b = \boxed{1109}$.

## See Also

 2007 iTest (Problems) Preceded by:Problem 43 Followed by:Problem 45 1 • 2 • 3 • 4 • 5 • 6 • 7 • 8 • 9 • 10 • 11 • 12 • 13 • 14 • 15 • 16 • 17 • 18 • 19 • 20 • 21 • 22 • 23 • 24 • 25 • 26 • 27 • 28 • 29 • 30 • 31 • 32 • 33 • 34 • 35 • 36 • 37 • 38 • 39 • 40 • 41 • 42 • 43 • 44 • 45 • 46 • 47 • 48 • 49 • 50 • 51 • 52 • 53 • 54 • 55 • 56 • 57 • 58 • 59 • 60 • TB1 • TB2 • TB3 • TB4
Invalid username
Login to AoPS