Problem
ALG-B3-M06-P002 Two Parity Classes
#2
★★☆☆☆ Level 2 of 5
Let \(f(n+2)=f(n)+6\), \(f(0)=2\), and \(f(1)=5\). Find \(f(n)\) for all \(n\in\mathbb Z\).
Consider even and odd \(n\) separately.
If \(n=2k\), then \(f(n)=2+6k=3n+2\). If \(n=2k+1\), then \(f(n)=5+6k=3n+2\). The answer is \(f(n)=3n+2\). The formula also works for negative \(k\), since the recurrence is reversible.
Example of compatible initial values for two classes.