Arithmetic Sequence
1. **State the problem:** Given an arithmetic sequence with the last term $a_n = 4$, common difference $d = 2$, and sum of $n$ terms $S_n = -14$, find $n$ (the number of terms) and $a$ (the first term).
2. **Recall formulas:**
- The $n$th term of the arithmetic sequence is given by $$a_n = a + (n-1)d$$
- The sum of the first $n$ terms is $$S_n = \frac{n}{2}(a + a_n)$$
3. **Use the given values:**
- Substitute $a_n = 4$ and $d = 2$ into the first formula:
$$4 = a + (n-1) \times 2$$
which simplifies to
$$a = 4 - 2(n-1) = 4 - 2n + 2 = 6 - 2n$$
4. **Substitute into the sum formula:**
Replace $a$ and $a_n$ in the sum formula:
$$-14 = \frac{n}{2}(a + 4) = \frac{n}{2}((6 - 2n) + 4) = \frac{n}{2}(10 - 2n)$$
Simplify the right side:
$$-14 = \frac{n}{2} \times (10 - 2n) = \frac{n}{2} \times 2(5 - n) = n(5 - n)$$
Therefore,
$$n(5 - n) = -14$$
5. **Solve the quadratic equation:**
Rewrite as:
$$5n - n^2 = -14$$
Bring all terms to one side:
$$-n^2 + 5n + 14 = 0$$
Multiply both sides by -1 to get a standard form:
$$n^2 - 5n - 14 = 0$$
6. **Apply the quadratic formula:**
$$n = \frac{5 \pm \sqrt{(-5)^2 - 4 \times 1 \times (-14)}}{2 \times 1} = \frac{5 \pm \sqrt{25 + 56}}{2} = \frac{5 \pm \sqrt{81}}{2}$$
So,
$$n = \frac{5 \pm 9}{2}$$
7. **Evaluate the roots:**
- $$n = \frac{5 + 9}{2} = \frac{14}{2} = 7$$
- $$n = \frac{5 - 9}{2} = \frac{-4}{2} = -2$$
Since $n$ must be positive, reject $n = -2$ and use $n = 7$.
8. **Find $a$:** Using $a = 6 - 2n$,
$$a = 6 - 2 \times 7 = 6 - 14 = -8$$
**Final answer:**
$$n = 7, \quad a = -8$$