All right! EV Training...
Please read this whole thing before training, as often I say not to do something after I say to :P
You did it the hard way. When using Protein, Iron, etc you can only use for first 100 EVs of that stat. For Attack, you are already over 100, so no more protein for infernape :)
But for Speed, you could boost four more times. It would only take you to 100 however.
You want to definitely max out Atk and Spd EVs. However, you can't because you used up some... Let's assume you want even Atk and Spd EVs.
510-13 you used = 497.
497 - extra 3 = 494 (I recommend putting them in HP.)
Assuming you boosted Speed to 100, that's 205. 494-205 = 289; one extra EV you can put in Atk.
Now we have 106 Atk/100 Spd, and some other extra stuff. We have 288 more Evs to put into those two stats, but we want to distribute evenly.
First, 6 more in Spd so you're even :) That's 282 to distribute, 106 Atk/106 Spd
282/2=141. 106+141 = 247, so 247 Atk/247 Spd.
But WAIT!! You only get a stat point if you have 4 EVs. You can either put 248 Atk/246 Spd, or vice versa.
There's no point in having the extra two EVs in Spd, so don't do those. Use 'em on some other stat that will get a point, like Sp. atk.
Final EV Spread:
9 HP/248 Atk (or vice versa)/244 Spd/5 Def/4 Sp. Atk
2 HP points, 62 Atk points, 61 Speed points, 1 Defense point, 1 Sp. Atk point
9 + 248 + 244 + 5 + 4 = 510 :)