Problem

Source: 2021 Thailand MO P2

Tags: algebra, Sequence



Determine all sequences $a_1,a_2,a_3,\dots$ of positive integers that satisfy the equation $$(n^2+1)a_{n+1} - a_n = n^3+n^2+1$$for all positive integers $n$.