Find the sum of the first five terms of a geometric series with g1 = -16, g5 = -38,316, and r = 7.

you have contradictory and un-needed information,

if a = -16 and r = 7
term(5) = ar^4 = -16(7^4) = - 38416
I suspect a typo

anyhow, we won't need that anyway

sum(5) = a(r^5 - 1)/(r-1)
= -16(7^5 - 1)/6
= -44816