Just take the number of oz in 1 gallon (128oz) and devide it by the oz of oil you are putting in. The number that come out will be the ratio to 1. Not exactly the easiest way, but it makes sense.

Example

1 gallon = 128oz

128oz gas ÷ 4oz oil = 32. Thus a 32:1 mix ratio.