2018 AMC 10 B

Complete problem set with solutions and individual problem pages

Problem 20 Hard

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\geqslant3. What is f(2018)? (2018 AMC 10B Problem, Question#20)

  • A.

    2016

  • B.

    2017

  • C.

    2018

  • D.

    2019

  • E.

    2020

Answer:B

f(n)=f(n-1)-f(n-2)+n

=(f (n-2)-f(n-3)+n-1)-f(n-2)+n

=2n-1-f(n-3)

=2n-1-(2(n-3)-1-f(n-6))

=f (n-6)+6

Thus, f (2018)=2016+f(2)=2017.

Start out by listing some terms of the sequence. f(1)=1, f(2)=1, f(3)=3, f(4)=6, f(5)=8, f(6)=8, f(7)=7, f(8)=7, f(9)=9, f(10)=12, f(11)=14, f(12)=14, f(13)=13, f(14)=13, f(15)=15\cdots. Notice that f(n)=n whenever n is an odd muttple of 3, and the pattern of numbers that follow will always be +3, +2, +0, -1, +0. The largest odd multiple of 3 smaller than 2018 is 2013, so we have f(2013)=2013, f(2014)=2016, f(2015)=2018, f(2016)=2018, f(2017)=2017, f(2018)= 2017.

Writing out the first few values, we get:1, 1, 3, 6, 8, 8, 7, 7, 9, 12, 14, 14, 13, 13, 15, 18, 20, 20, 19, 19\cdots . Examining,we see that every number x where x≡1 (\rm mod \ 6) has f(x)=x, f(x+1)=f(x)=x, and f(x-1)=f(x-2)=x+1. The greatest number that's 1 (\rm mod \ 6) and less 2018 is 2017,so we have f(2017)=f(2018)=2017.