There are many ways to proceed, but the most straightforward is FindSequenceFunction
, moreover we can use as well FindLinearRecurrence
with RSolve
or even Factor
since it can provide obvious hints to make adequate conclusions.
Factor
Factor @ {a + 1, a^2 + 2 a + 1, a^3 + 3 a^2 + 3 a + 1}
{1 + a, (1 + a)^2, (1 + a)^3}
Now we can simply conclude that the general term is (1 + a)^n
.
FindLinearRecurrence
Let's try FindLinearRecurrence
giving the linear recurrence generating a given sequence of functions:
FindLinearRecurrence[{a + 1, a^2 + 2 a + 1, a^3 + 3 a^2 + 3 a + 1}] // Simplify
{1 + a}
now it might be the best way to use e.g. RSolve
:
RSolve[{f[n + 1] == (a + 1) f[n], f[1] == a + 1}, f[n], n]
{{f[n] -> (1 + a)^n}}
FindSequenceFunction
A bit more straightforward way would be FindSequenceFunction
yielding the result in terms of a pure function (if not specified the independent variable):
FindSequenceFunction[{a + 1, a^2 + 2 a + 1, a^3 + 3 a^2 + 3 a + 1,
1 + 4 a + 6 a^2 + 4 a^3 + a^4}]
(1 + a)^#1 &
or just what you'd expect in traditional form (when the variable is specified):
FindSequenceFunction[{a + 1, a^2 + 2 a + 1, a^3 + 3 a^2 + 3 a + 1,
1 + 4 a + 6 a^2 + 4 a^3 + a^4}, n]// TraditionalForm
FindSequenceFunction
$\endgroup$