the sum of consecutive odd numbers If the sum of consecutive odd numbers starting with $-3$ until $2k+1$ equals $21$
What is the value of $k$ ?
I can solve this by trying the numbers $-3-1+1+3+5+7+9=21$ , so the last term is $7th$ so the $k$ value is $3$
But I could not solve this with formula, I know the odd numbers come in the form of $2k+1$ but could not get much further.

You can reduce this sequence: $-3-1+1+3+5+7+9=21$.
$-3-1+1+3=0$. So you are being left with:
$5+7+9=21$. Since the last term is $9$ and the last term in your question is $2k+1$ we have:
$2k+1=9$
$2k=9-1$
$k=8:2$
$k=4$
Edit:
I would like to add, that your confusion might come from how you are understand "until $2k+1$". One might say: until some term or until some number. In the first instance you are right: $k=3$. In the second: $k=4$. Two following steps can help:
We can write an Arithmetic Sequence as a rule:
$X_n=a_1 + d(n-1)$
$a_1$ - first term
$d$ - common difference
$n$ - number of terms
Since you have $7$ terms, last term is equal:
$X_7=-3+(7-1)2=-3+12=9$
Before you can calculate the above first we need to find this $7$, therefore to sum up the terms of this arithmetic sequence you can use formula:
$\sum_{k=1}^{n}(a+kd)=\frac{n}{2}(2a+(n-1)d)$
$21=\frac{n}{2}(-6+2n-2)$
$21=-3n+n^2-n$
$n^2-4n-21=0$
Δ $=16-4*1*(-21)=16+84=100$
$n_1=7$ and $n_2=-3$
