Skip to main content

2018 AMC 10B Problem 20

Problem 20 of 25HarderAlgebra

A function ff is defined recursively by f(1)=f(2)=1f(1) = f(2) = 1 and f(n)=f(n1)f(n2)+nf(n) = f(n - 1) - f(n - 2) + n for all integers n3.n \ge 3. What is f(2018)?f(2018)?

Answer choices

Show solution

Solution

Notice f(n)=n+1f(n) = n + 1 solves the recurrence on its own, so write f(n)=(n+1)+g(n).f(n) = (n + 1) + g(n). Then gg satisfies the homogeneous version g(n)=g(n1)g(n2).g(n) = g(n-1) - g(n-2). With g(1)=1g(1) = -1 and g(2)=2,g(2) = -2, it cycles with period 66: 1,2,1,1,2,1,.-1, -2, -1, 1, 2, 1, \ldots. Since 20182(mod6),2018 \equiv 2 \pmod 6, we get g(2018)=2,g(2018) = -2, so f(2018)=20192=2017.f(2018) = 2019 - 2 = 2017. Therefore, the answer is B.

More practice

Concepts: recursion · pattern recognition

Problem text and solution from the LIVE past-contest archive. See also the AoPS wiki page for community solutions.