2*4 - 7 = 1: Fill (4), pour (4) -> (7), Fill (4), pour (4) into (7) till (7) is full. 1 liter is left in 4.
2*(2*4 - 7) = 2: After doing the above, empty (7), pour the 1 liter left in (4) into (7), then do the same steps as before again. But this time you are left with 2 liters in the (4) when the (7) is filled.
3 liters can be obtained as you've indicated. Higher amounts can be obtained by putting 0, 1, 2, 3 or 4 liters in one of the buckets, then completely filling the other.