Observe the pattern:
(2→5)(+3)
(5→10)(+5)
(10→17)(+7)
(17→28)(+11)
(28→40)(+12)
(40→58)(+18)
The intended pattern seems to be adding consecutive prime numbers:
+3, +5, +7, +11, +13, +17
So after 28, it should be:
(28 + 13 = 41), not 40.
Then:
(41 + 17 = 58)
Therefore, the number that breaks the pattern is 40.