calculating error, quickest way

I'm using this to change the OCR1A value to get the desired freq
OCR1A = (8000000/freq)-1
So say I want 247khz the ocra would be 31 and the actual freq is 258064, so quite an errror, I could just jump by ocra values at a certain point where the error gets large but idk if there's an easier way