Is this a typo?

Code:
	for(c=2; c<max; i++)
Otherwise, it looks like it should work.