You know probably the number off all functions from $\lbrace 1,2,3 \rbrace$ to
$\lbrace 1,2\rbrace$ and
a function which is NOT surjective must be constant since the range has only two elements.
So you have at most a 7-digit number (since 10,000,000 isn't a possibility): X-X-X-X-X-X-X, and the 12 can be in 6 different positions, so you have 1-2-X-X-X-X-X, X-1-2-X....,X-X-X-X-X-1-2. That is a total of $6*10^5 = 600,000$ different numbers. Now the hard part like I said above is finding the overlaps.
Suppose 12 were to appear twice, that means that we have 3 open spaces otherwise. How many ways can we reorder the two 12's and the extra 3 spots? That would be ${5\choose2} = 10$. Since the open spots can be $10^3$ different numbers, we end up with $10*10^3 =10,000$ overlaps.
Suppose 12 were to appear three times, that means we have 1 open space otherwise. How many ways can we reorder the three 12's and the extra spot? ${4\choose1} = 4$. Since the open spots can be 10 different numbers, we end up with $4*10 = 40$ overlaps.
However, if 12 were to appear three times, that means 12 also appears 2 times, and so instead of have $10,000$ overlaps (from the first overlap case), we actually have $10,000 - 40 = 9960$ total overlaps.
With $10,000,000$ different numbers, we end up with (total numbers - total overlaps) = $10,000,000 - (600,000-9960) = 9,409,960$ which I verified with Java.
Best Answer
Let $m_2$ be greatest such that $m_2^2 \le 10000$, then there are $m_2$ squares between $1$ and $10000$, because if we list all the squares we have $$\underbrace{1^2,\ 2^2,\ \dots, (m_2-1)^2,\ m_2^2}_{\le 10000},\ \underbrace{(m_2+1)^2,\ (m_2+2)^2,\ \cdots}_{>10000}$$ Define $m_3$ and $m_6$ similarly, and then apply inclusion-exclusion.