I want to create a formula for summing an arithmetic sequence in which the first term is 'a1' and the nth term is 'an' through the following formula.
${{S_n}}$ = \frac{n(${{a_1}}$+${{a_n}}$)}{2}
However, the result is as follows.
How could I solve this problem? I am currently working on overleaf.
I'm worried that since my native language is not English and I am new to LaTeX, my question may seem a bit odd.


$S_n = \frac{n(a_1+a_n)}{2}$is the correct input. See What are good learning resources for a LaTeX beginner? – egreg Sep 05 '22 at 22:13$at the beginning and again at the end. Also, you don't need so many braces:$S_n = \frac{n(a_1+a_n)}{2}$– Sandy G Sep 05 '22 at 22:14$S_n = \frac{n(a_1 + \ldots + a_n)}{2}$with an ellipsis representing a₂, a₃, etc., but I might be misunderstanding. – frabjous Sep 05 '22 at 22:17$S_n = a_1+\dots+a_n = n(a_1+a_n)/2$. – Teepeemm Sep 06 '22 at 02:08