My approach does what you require:
If less than or equal to 3 then use shg formula and multiply by 2, else:
if less than or equal to 7 return 3 and multiply by 2 (which will always be 6)
if neither of these is correct the number must be gretaer than 7 therefore return 4 multiplied by 2 (which is always 8)
Bookmarks