There are plenty of online dilution calculators, but if you want a formula, the below was taken from Mechanics of No Sparge Brewing:
The Dilution Formula (reference Ray Daniels, Designing Great Beers)
Most of the dilution/gravity calculations found in this write up are based on a simple formula that states:
Beg Volume * Beg Gravity=End Volume * End Gravity
(The Gravity numbers are Gravity Points, i.e. 1.060 OG=60 gravity pts,
1.045=45 gravity pts.)
By algebraically re-arranging this formula, we can find any element in
the formula, as in:
Beg Volume=End Volume * End Gravity / Beg Gravity
Beg Gravity=End Volume * End Gravity / Beg Volume
End Gravity=Beg Volume * Beg Gravity / End Volume
End Volume=Beg Volume * Beg Gravity / End Gravity
So, in your case:
End Gravity = 3.5 * 60 / 4 = 52.5
So about 1.053, which agrees with Beersmith's calculator.