Interesting problem. For starters I wrote a program to verify the numbers you mentioned. The computer constructs a random p-digit string to represent a serial number, then picks m random digit characters. It then checks whether all of the m digits picked occur at least once in the string. I ran this through a loop 100 000 000 times, counting the number of times all m were in the string, and then returning the count. This way the significant digits of the count would be the significant digits of the proportion. The sample proportions I observed for n=10, p=3 were consistently within .0001 of .271, .054, and .006 for m=1, 2, and 3, respectively. When I upped the string length to 8, the computer took longer to get through 100 000 000 plays, but when it finally came back with an answer, it was in the ballpark of 15 427 000, which corresponds closely with the figure you mentioned.
I then realized I could get the computer to count all of the 8-digit strings that have three distinct given digits, so I wrote another program that runs through a loop for every integer from 0 to np - 1. Every time through the loop, it constructs an equivalent p-digit string to represent the integer of the current pass by prepending 0s to the integer until it is p digits in length. It then checks the resulting string for three distinct digit characters, the same three every time through the loop, and if on a given pass all three are present, it increments the count. After np string representations corresponding to integers 0 to np - 1 have been checked, it returns the count. When I ran this program with n=10, p=8, and m=3, it returned 15 426 684, which, expressed as a proportion out of the 100 000 000 total possible 8-digit strings, is .15426684. Not only is this the exact proportion you seek, but whereas the computer required nearly a full minute to get through 100 000 000 plays using my empirical method, I only waited five seconds for the computer to get back this time.
While these algorithms are a quick and nifty way to get the correct answer, I think this problem deserves better from me, so I'm going to get right down to the statistics of it. First we must acknowledge that in searching a serial number, every digit place you check either contains a digit of interest whose presence among the string is uncertain (success), or it does not (failure); furthermore, there is only one way that a given digit of interest can occur at a given digit place in the string. We will know the string contains our three distinct digits if and when we have three successes; we need not look further. The first success can occur in one of three ways at a given digit place since it can contain any of the three distinct digits of interest. Given this success, we are now only interested in the two digits remaining, so our definition of success changes to include only those two. The second success can occur in one of two ways at any subsequent digit place. Given the second success, we redefine success yet again to include only the last digit of interest, so the third success can only occur in one way at any subsequent digit place. If we have three successes before we get to the end of the string, then any permutations of the remaining digits to check count toward the number of strings that contain our three.
Let Y denote a success, N a failure, and E any outcome following the third success. We're interested in all string permutations that have three successes (i.e. contain all three digits of interest). Following is a table of all possible string combinations where we have three successes. Traversing a row to the right represents placing the first success further into the string, and as a consequence, there are fewer combinations whose first successes start at that digit place, symbolized by successively shorter columns.
YYYEEEEE NYYYEEEE NNYYYEEE NNNYYYEE NNNNYYYE NNNNNYYY
YYNYEEEE NYYNYEEE NNYYNYEE NNNYYNYE NNNNYYNY
YYNNYEEE NYYNNYEE NNYYNNYE NNNYYNNY NNNNYNYY
YYNNNYEE NYYNNNYE NNYYNNNY NNNYNYYE
YYNNNNYE NYYNNNNY NNYNYYEE NNNYNYNY
YYNNNNNY NYNYYEEE NNYNYNYE NNNYNNYY
YNYYEEEE NYNYNYEE NNYNYNNY
YNYNYEEE NYNYNNYE NNYNNYYE
YNYNNYEE NYNYNNNY NNYNNYNY
YNYNNNYE NYNNYYEE NNYNNNYY
YNYNNNNY NYNNYNYE
YNNYYEEE NYNNYNNY
YNNYNYEE NYNNNYYE
YNNYNNYE NYNNNYNY
YNNYNNNY NYNNNNYY
YNNNYYEE
YNNNYNYE
YNNNYNNY
YNNNNYYE
YNNNNYNY
YNNNNNYY
Now I will rewrite every combination as a chain product of the number of ways each of its successive outcomes could happen: the first success (3), the second success (2), the third success (1), any failures before the first success (7), any failures between the first and second successes (8), any failures between the second and third successes (9), and any outcomes after the third success (10). In this way I account for every permutation of interest.
Permutations whose first successes occur at the first digit place:
3\times2\times1\times10\times10\times10\times10\times10=600 000
3\times2\times9\times1\times10\times10\times10\times10=540 000
3\times2\times9\times9\times1\times10\times10\times10=486 000
3\times2\times9\times9\times9\times1\times10\times10=437 400
3\times2\times9\times9\times9\times9\times1\times10=393 660
3\times2\times9\times9\times9\times9\times9\times1=354 294
3\times8\times2\times1\times10\times10\times10\times10=480 000
3\times8\times2\times9\times1\times10\times10\times10=432 000
3\times8\times2\times9\times9\times1\times10\times10=388 800
3\times8\times2\times9\times9\times9\times1\times10=349 920
3\times8\times2\times9\times9\times9\times9\times1=314 928
3\times8\times8\times2\times1\times10\times10\times10=384 000
3\times8\times8\times2\times9\times1\times10\times10=345 600
3\times8\times8\times2\times9\times9\times1\times10=311 040
3\times8\times8\times2\times9\times9\times9\times1=279 936
3\times8\times8\times8\times2\times1\times10\times10=307 200
3\times8\times8\times8\times2\times9\times1\times10=276 480
3\times8\times8\times8\times2\times9\times9\times1=248 832
3\times8\times8\times8\times8\times2\times1\times10=245 760
3\times8\times8\times8\times8\times2\times9\times1=221 184
3\times8\times8\times8\times8\times8\times2\times1=196 608
Sum: 7 593 642
Permutations whose first successes occur at the second digit place:
7\times3\times2\times1\times10\times10\times10\times10 = 420 000
7\times3\times2\times9\times1\times10\times10\times10 = 378 000
7\times3\times2\times9\times9\times1\times10\times10 = 340 200
7\times3\times2\times9\times9\times9\times1\times10 = 306 180
7\times3\times2\times9\times9\times9\times9\times1 = 275 562
7\times3\times8\times2\times1\times10\times10\times10 = 336 000
7\times3\times8\times2\times9\times1\times10\times10 = 302 400
7\times3\times8\times2\times9\times9\times1\times10 = 272 160
7\times3\times8\times2\times9\times9\times9\times1 = 244 944
7\times3\times8\times8\times2\times1\times10\times10 = 268 800
7\times3\times8\times8\times2\times9\times1\times10 = 241 920
7\times3\times8\times8\times2\times9\times9\times1 = 217 728
7\times3\times8\times8\times8\times2\times1\times10 = 215 040
7\times3\times8\times8\times8\times2\times9\times1 = 193 536
7\times3\times8\times8\times8\times8\times2\times1 = 172 032
Sum: 4 184 502
Permutations whose first successes occur at the third digit place:
7\times7\times3\times2\times1\times10\times10\times10 = 294 000
7\times7\times3\times2\times9\times1\times10\times10 = 264 600
7\times7\times3\times2\times9\times9\times1\times10 = 238 140
7\times7\times3\times2\times9\times9\times9\times1 = 214 326
7\times7\times3\times8\times2\times1\times10\times10 = 235 200
7\times7\times3\times8\times2\times9\times1\times10 = 211 680
7\times7\times3\times8\times2\times9\times9\times1 = 190 512
7\times7\times3\times8\times8\times2\times1\times10 = 188 160
7\times7\times3\times8\times8\times2\times9\times1 = 169 344
7\times7\times3\times8\times8\times8\times2\times1 = 150 528
Sum: 2 156 490
Permutations whose first successes occur at the fourth digit place:
7\times7\times7\times3\times2\times1\times10\times10 = 205 800
7\times7\times7\times3\times2\times9\times1\times10 = 185 220
7\times7\times7\times3\times2\times9\times9\times1 = 166 698
7\times7\times7\times3\times8\times2\times1\times10 = 164 640
7\times7\times7\times3\times8\times2\times9\times1 = 148 176
7\times7\times7\times3\times8\times8\times2\times1 = 131 712
Sum: 1 002 246
Permutations whose first successes occur at the fifth digit place:
7\times7\times7\times7\times3\times2\times1\times10 = 144 060
7\times7\times7\times7\times3\times2\times9\times1 = 129 654
7\times7\times7\times7\times3\times8\times2\times1 = 115 248
Sum: 388 962
Permutations whose first successes occur at the sixth digit place:
7\times7\times7\times7\times7\times3\times2\times1 = 100 842
Sum: 100 842
By taking the sum of these six sums of sets of permutations, we have determined that there are 15 426 684 8-digit strings that contain each of any three distinct digits. Therefore we can find the probability that all three digits you guess are in the serial number on a dollar bill in the following way:
P(win)=\frac{15426684}{100000000}=0.15426684
Applying this whole process in general involves setting up p-m+1 sets of combinations, where the sets explore combinations whose first successes occur anywhere from the first digit place to the (p-m+1)th digit place. The way you consider all the combinations in a given set seems to involve moving the last success from right after the preceding success along to the end, then starting the process over again for every position closer to the end the preceding success is moved, and then starting that over again for every position closer to the end the success that precedes that one is moved, and so on, such that the number of combinations follows a binomial pattern. To get permutations from combinations, you substitute the number of ways each outcome can happen. At the beginning, there will always be m ways for a success to occur at any spot and n-m ways for a failure to occur. Every time you mark down a success, the number of ways for a success to occur at any subsequent spot decrements by one and the number of ways for a failure to occur increments by one. Marking failures does not change the number of ways either can occur. Lastly, once m successes have been marked down, any subsequent spots can take on any of the n possible values. Then it's just a matter of summing the sets of permutations of interest and dividing by the total possible number of permutations. I'd like to think that your formula is mathematical shorthand for carrying out this long-winded process, but if there's one thing I can guarantee, its that your formula is completely backed by the results I've obtained from each of the methods I've used to tackle this problem.