Example 2.21 (Sums of Squares)

Working with the recurrence for a sum of squares.
Requirements: ore_algebra package

Instead of using the built-in functions of ore_algebra, we can solve an explicit system to derive a recurrence satisfied by the difference of the sum and the closed form, which we then show is zero.
(There is no point -- other than pedagogical completeness -- in doing this when ore_algebra will do it for you, and in less time!)