Problem 1062: (2018 AMC 10b, 20; 2018 AMC 12b, 18)
A function $f$ is defined recursively by $f(1)=f(2)=1$ and \[f(n)=f(n-1)-f(n-2)+n\] for all integers $n \geq 3$. What is $f(2018)$?
$\textbf{(A)}\ 2016$ $\textbf{(B)}\ 2017$ $\textbf{(C)}\ 2018$ $\textbf{(D)}\ 2019$ $\textbf{(E)}\ 2020$
- Substituting $f(n-1)=f(n-2)-f(n-3)+(n-1)$ into $f(n)=f(n-1)-f(n-2)+n$ gives $f(n)+f(n-3)=2n-1$. Using this also for $n-3$, $f(n-3)+f(n-6)=2n-7$, and subtracting, $f(n)-f(n-6)=6$.
- $2018=2+6\cdot336$, so $f(2018)=f(2)+6\cdot336=2017$. The answer is (B).
A function is defined by $f(1)=1$, $f(2)=2$, and $f(n)=f(n-1)-f(n-2)+n$ for $n\ge3$. What is $f(2025)$?