Hecarim's mana at level 1 is 277 , and the Q cost is 32 mana . If you make the math there is enough mana for 8.65 Qs . To cast the first 2 times it take 7 seconds considering cooldown (without cooldown reduction) then the next Q's have a 2 second cooldown so you could cast it 6 more times until your mana would run out which would mean 12 seconds . Now if you add the cooldowns then you would have 19 seconds in which you can regen your mana , so you would have another 123.5 bonus mana until then. Making the calculations again you would have 400.5 mana which is enough to cast 12.5 Q's in that time , and you would need another 16 mana to cast a 13th Q which would require about 2.5 seconds.
Note that I didn't use any formulas , so my logic could have been wrong (especially because I am not sure if the second cast of Q will have it's cooldown reduced or it will affect the one after that) but this can give you an idea . Also , I did this in a short amount of time so I probably made mistakes.
By the way , these are his base stats , Mana Regeneration Masteries would also add a fair amount of mana to your mana pool in that amount of time and if you played him jungle then the Hunter's Machete would also grant you more than your base amount of mana regen so that will also increase your ability to spam it . If you play him top then it is harder , especially because you do not get the health and mana back from killing large monsters.