If a is the first term of an AP with common difference -2, then the first several terms are
a, a - 2, a - 4, a - 6, a - 8, …
with n-th term a - 2 (n - 1).
The sum of the first n terms is equal to the sum of the first 3n terms :

We have

so that in the previous equation, the sums reduce to

Solve for a :

Now if a = 27, we have
27 = 4n - 1
28 = 4n
n = 7
as required.