It's poorly told, because that's not really the joke.
A mathematician, a physicist and an engineer enter a mathematics contest, the first task of which is to prove that all odd number are prime. The mathematician has an elegant argument: `1's a prime, 3's a prime, 5's a prime, 7's a prime. Therefore, by mathematical induction, all odd numbers are prime. It's the physicist's turn: `1's a prime, 3's a prime, 5's a prime, 7's a prime, 11's a prime, 13's a prime, so, to within experimental error, all odd numbers are prime.' The most straightforward proof is provided by the engineer: `1's a prime, 3's a prime, 5's a prime, 7's a prime, 9's a prime, 11's a prime ...'.
OR
How a mathematician, physicist and an engineer prove that all odd numbers, (greater than 2), are prime.
Mathematician: "Well, 3 is prime, 5 is prime and 7 is prime so, by induction all odds are prime."
Physicist: "3 is prime, 5 is prime, 7 is prime, 9 isn't prime, (bad data point), 11 is prime, and so is 13, so all odds are prime."
Engineer: "3 is prime, 5 is prime, 7 is prime, 9 is prime, 11 is prime 13 is prime, so all odds are prime."
Done in full, it's a clever play on the fact that the mathematician misapplies a basic approach, the physicist takes an experimental approach and expects themselves to err, and the engineer simply takes it at face value. By taking it as an axiom, they simply solve the problem in the most efficient way possible. If that's what they are, then that's what they are.
Ultimately, they joke is that they are ALL idiots in their own special way. ^_^