Phone number algorithm If a phone number were turned into an equation, how difficult would it be to reverse engineer the original phone number ? How many potential (10 digit, North American) phone numbers could a solution be narrowed down to?
That is to say if:
1 (555) 123-4567 became 1 * 555 * 123 - 4567 = 63698 
or
1 * A * B - C = D,
how many potential values for A, B & C could be produced from any value D?
63698 = 1 * ? * ? - ?
Given: The number originates in the USA, and thereby conforms to the North American Numbering Plan (NXX-NXX-XXXX,where N is any digit 2-9 and X is any digit 0-9).From this we know A and B to be a subset of 3 digit numbers and C to be a 4 digit number.
What approaches would be best when thinking about this problem?
 A: The max hash value of a phone number is (approximately) $1000\cdot 1000-0=10^6$. The min hash value is $100\cdot 100-10000=0$. The number of legal phone numbers is $8^210^8=6.4\cdot 10^9$.  This means that (on average) approximately $\frac{6.4\cdot 10^9}{10^6}=6400$ phone numbers correspond to one hash value. I don't know if this is what you're looking for, but it is a reasonable first approximation I think. Thus, there are $6400$ triples $(A,B,C)$ on average for each hash value.
A: I might get railed for this one, but just compute it for all possible values.
You'd only need to compute the cases for which $A \geq B$ (say) because multiplication is commutative.
So compute all of the products $AB$ that you need ($A \geq B$), and organize them in a histogram with bin size of $1$.  If $A \neq B$, count it twice.  Then copy this histogram $9999$ more times, displacing one copy apiece each of $1$ to $9999$ places to the left, and add them all up.
A: Given D, I would loop $n$ from $0$ to $9999$, factor $D+n$ then look for ways to split the factors to make acceptable numbers. Note that $D$ has to be at least $200^2-9999=30001$ if I wanted the $D$ that yielded the most choices, I would fill an array with the number of representations of numbers from $30001$ to $999^2$ and then find the span of $10000$ with the highest total.
