The probability you calculated (17%) is the probability that you do NOT catch Azelf after throwing 34 Dusk Balls at it. 100% - 17% = 83% is the probability that you catch Azelf with 34 Dusk Balls.
Also, that percentage is a bit off. I'm almost sure that the value should be 'floored' before dividing by 256. That would give it a probability of 4.6875% of catching Azelf. If Azelf is asleep, the probability would increase to 8.59375%.
In the first case, the average number of Dusk Balls required to catch Azelf is 22. For the second case, it is 12. I don't know if this corresponds to what really happens.
EDIT: By the way, McGraw's formula would correspond exactly to Peterko's if he removed that [4 *] before the X, making it (X-2*Y)*A*B/X+1+S.
Yes I was aware of that it was a 17% chance that the pokemon would *not* be caught; I apologize if my word choice was ambiguous enough to prevent this from coming through.
I miscalculated originally using McGraw's formula (apropos the discrepency); for some reason I reused 145 as the min (should have used 1). This is what happens when you do basic math past midnight after pouring over mindless duskball spamming for hours while simultaneously studying random college history. Apparently this also leads you to formulate run-on sentences the day after.