in reply to condensing code

I'd divide $total_nums by 30 and check the remainder.