Problem
ALG-B3-M06-P017 Square Recurrence
#17
★★★★★ Level 5 of 5
Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=0\), and \(f(n+1)-f(n)=2n+1\). Find \(f(n)\).
Sum odd numbers.
For \(n>0\), \(f(n)=\sum_{k=0}^{n-1}(2k+1)=n^2\). For negative \(n\), move backwards: \(f(n)=f(n+1)-(2n+1)\), and the same formula \(n^2\) satisfies the recurrence and the initial value. The answer is \(f(n)=n^2\).
Recursive form of the square.