I have a problem with finding the sum of this geometric series. (the characters in italics are supposed to be smaller)

a1= 2, a6= 486, r = 3

So, applying the sum formula:

Sn= a1(1 - r^n) / 1 - r

Sn= 2 (1 - 3^n) / 1 - r

I don't have n to figure it out with this formula, instead I have a6,the 6th term. What am I supposed to do with that?