The sum is 340.
Since the nth term is given as 256 but n is given as 4, that means 256 is the 4th term. But the 4th term of a GP equals ar^3, where a is the first term and r is the common ratio of the GP. Dividing 256 by the first term (which is given as 4) shows us that r^3 = 256/4 = 64.
If r^3 = 64, then the common ratio r must equal 4 as well. This gives us all the information we need to use the formula for the sum of a GP, S = (a(r^n - 1))/(r - 1).
In this case, S = (4(4^4 - 1))/(4 - 1) = (4(256 - 1))/3 = 1020/3 = 340.