Number of ways to reach $(20,13)$ from $(3,3)$ that doesn't go through coordinate points whose both values are composite. 
Rahul is at $(3,3)$ on the coordinate plane. In each step, he can move one point up or one point to the right. He loves primes and will never visit a coordinate point where both values are composite. In how many ways can he reach $(20,13)$?

The problem is from a national Olympiad held last year. Here are my thoughts regarding the problem:
Number of ways to reach $(20,13)$ from $(3,3)$ that doesn't go through $(4,4)$ is: $\binom{17+10}{10}-\binom{2}{1}\cdot\binom{16+9}{9}$.
Number of ways to reach $(20,13)$ from $(3,3)$ that doesn't go through $(4,6)$ is: $\binom{17+10}{10}-\binom{4}{1}\cdot\binom{16+7}{7}$.
Following this step for all $(x,y)$ where $x$ and $y$ both are composite and summing them all, we get the desired result.
This approach is very lengthy and impossible to compute in a contest. Still I'm not sure if I didn't over count in the solution. I believe there is an easy and elegant solution of the problem. So, what's the solution? Please provide detailed explanation as I'm new to this kind of topics.
 A: Let's form a grid with the prime number coordinates from 3-20 as the x-coordinate, and 3-13 as the y coordinate.

\begin{array}{|c|c|c|}
  \hline
  (3,19) & (5,19) & (7 ,19)& (11,19) & (13,19)\\
  \hline
  (3,17) & (5,17) & (7,17)& (11,17) & (13,17)\\
  \hline
  (3,13) & (5,13) & (7,13) & (11,13) & (13,13)\\
  \hline
  (3,11) & (5,11) & (7,11) & (11,11) & (13,11)\\
  \hline
  (3,7) & (5,7) & (7,7) & (11,7) & (13,7)\\
  \hline
  (3,5) & (5,5) & (7,5) & (11,5) & (13,5)\\
  \hline
  (3,3) & (5,3) & (7,3) & (11,3) & (13,3)\\
  \hline 
\end{array}
Because that one coordinate should always be prime, Rahul can move between these points in a single way.
He'll have to move 4 right, and 6 up, making 10 total.
There are ${6+4 \choose 6}$ ways of deciding when to go up in a directions list like this:
UURRRUUUUR
The answer is ${6+4 \choose 6} = 210$
A: You could use a grid approach, and then spot that you can in effect ignore cases where either number is composite.  For example, the number of paths to $(20,13)$ is equal to the number of paths to $(19,13)$ since $(20,12)$ is inaccessible
There are the $4$ primes $5,7,11,13$ which are greater than $3$ and less than or equal to $13$ and the   $6$ primes $5,7,11,13,17,19$ which are greater than $3$ and less than or equal to $20$
so the number of paths is ${6+4 \choose 4}=210$
