1) Watch the episode of Pokemon called Mystery at the Lighthouse.
2) Ash calls Professor Oak, who says that Gary has caught 45 Pokemon.
3) Then, watch Primeape Goes Bananas.
4) Professor Oak says that Gary has 30 Pokemon! How did that happen? 2 reasons, either Gary gave up his Pokemon, or Professor Oak ate them. (In the Lighthouse episode, he talked about eating Gary's Krabby!)