By the binomial theorem,

The
term occurs for i = 2, and the
term for i = 3. If the coefficient of the squared term is 3 times larger than the coefficient of the cubed term, then

Solve for k :

Since k ≠ 0, it follows that
k - (n - 2) = 0
or
k = n - 2
as required.