Consider a geometric sequence where the first term is \( a = 8 \) and the common ratio is \( r = 2 \). If the sum of the first \( n \) terms of this sequence is 2040, find the value of \( n \). Let's think step by step and output the final answer within \boxed{}.
user