There are roughly 3 and 1/2 40oz bottles in 1 gallon.
In 1 gallon there are 128 ounces and it takes three 40oz bottles to make 120 ounces so you'll need slightly over 3 bottles of 40 ounce size to make 1 gallon.
It takes eight 16 oz bottles to make 1 gallon.
There are 128 ounces of liquid in 1 gallon of liquid so to equal 1 gallon with 16 ounce bottles you would need 8 of those 16 oz bottles.
If you have 8 ounce bottles then it would take 16 of those 8 ounce bottles to make 1 gallon.
There are always 128 ounces in 1 gallon.
So to find out how many bottles of a size you have to make 1 gallon you take the size of the bottle and multiply that by the number needed to get 128 ounces.
In 2 gallons there are 256 ounces.
In 4 gallons there are 512 ounces and so on and so forth.