What's wrong with this sequential reasoning for a formula for a_n? The following sequence is given. Write a formula for $a_n$.
$\displaystyle\{1,2,4,7,11,16\}$
Note the arithmetic formula.
$\displaystyle a_n=a_1+\left(n-1\right)d$
Define $d$ as $d_n$, where $d_n$ is the difference between term $n$ and its succeeding term, $n+1$.
$\displaystyle a_n=a_1+\left(n-1\right)d_n$
$\displaystyle d_n=d_1+\left(n-1\right)g$
Where $g$ is the common difference for $d_n$.
$\displaystyle a_n=a_1+\left(n-1\right)\left(d_1+\left(n-1\right)g\right)$
$a_n\in\{1,2,4,7,11,16\}$
$d_n\in\{1,2,3,4,5\}$
$g=1$
$\displaystyle a_n=a_1+\left(n-1\right)\left(d_1+\left(n-1\right)\right)$
$\displaystyle a_n=1+\left(n-1\right)\left(1+\left(n-1\right)\right)$
$\displaystyle a_n=n^2-n+1$
But this doesn't yield the correct sequence.

As others have already suggested in their comments and answer, your mistake lies in the step $a_n=a_1+(n-1)d_n$. Actually it should be replaced by $\boxed{a_n=a_1+\sum_\limits{i=1}^{n-1}d_i}$ where $n \ge2 $.
The rest of the solution will be as you have solved.
