Problem
ALG-B3-M01-P007 Difference equation
#7
★★★☆☆ Level 3 of 5
Let \(f:\mathbb N^{*}\to\mathbb Z\), \(f(0)=0\), and \(f(n+1)-f(n)=3n+1\). Find \(f(n)\).
Hint. Sum \(3k+1\).
\(f(n)=\sum_{k=0}^{n-1}(3k+1)=3n(n-1)/2+n=\frac{n(3n-1)}2\).
Goal: separate guessing the answer from a complete proof and domain check.