please help with sequences and series problem!

In an arithmetic sequence, consecutive terms are separated by a common difference [tex]d[/tex] and are given recursively by
[tex]a_n=a_{n-1}+d[/tex]
So we can write [tex]a_{51}[/tex] in terms of [tex]a_{11}[/tex] by substituting recursively:
[tex]a_{51}=a_{50}+d[/tex]
[tex]a_{51}=(a_{49}+d)+d=a_{49}+2d[/tex]
[tex]a_{51}=(a_{48}+d)+2d=a_{48}+3d[/tex]
and so on up to
[tex]a_{51}=a_{11}+40d[/tex]
(notice how in [tex]a_x+yd[/tex], it's always true that [tex]x[/tex] and [tex]y[/tex] add up to 51)
We're given that [tex]a_{11}=23[/tex] and [tex]a_{51}=183[/tex], so we can solve for [tex]d[/tex]:
[tex]183=23+40d\implies40d=160\implies d=40[/tex]
We can use the same strategy to find the first term in the sequence:
[tex]a_{11}=a_{10}+40[/tex]
[tex]a_{11}=(a_9+40)+40=a_9+80[/tex]
[tex]a_{11}=(a_8+40)+80=a_8+120[/tex]
and so on up to
[tex]a_{11}=a_1+400[/tex]
[tex]23=a_1+400\implies a_1=-377[/tex]
In general, the sequence has a pattern of
[tex]a_n=a_{n-1}+40[/tex]
[tex]a_n=(a_{n-2}+40)+40=a_{n-2}+2\cdot40[/tex]
[tex]a_n=(a_{n-3}+40)+2\cdot40=a_{n-3}+3\cdot40[/tex]
and so on up to
[tex]a_n=a_1+(n-1)\cdot40[/tex]
So this sequence is given by the rule
[tex]a_n=-377+40(n-1)\implies \boxed{a_n=40n-417}[/tex]