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.