Difference between revisions of "2018 AMC 10B Problems/Problem 20"

(Created page with "A function <math>f</math> is defined recursively by <math>f(1)=f(2)=1</math> and <cmath>f(n)=f(n-1)-f(n-2)+n</cmath>for all integers <math>n \geq 3</math>. What is <math>f(201...")
 
Line 1: Line 1:
 +
==Problem==
 +
 
A function <math>f</math> is defined recursively by <math>f(1)=f(2)=1</math> and <cmath>f(n)=f(n-1)-f(n-2)+n</cmath>for all integers <math>n \geq 3</math>. What is <math>f(2018)</math>?
 
A function <math>f</math> is defined recursively by <math>f(1)=f(2)=1</math> and <cmath>f(n)=f(n-1)-f(n-2)+n</cmath>for all integers <math>n \geq 3</math>. What is <math>f(2018)</math>?
  
 
<math>\textbf{(A)} \text{ 2016} \qquad \textbf{(B)} \text{ 2017} \qquad \textbf{(C)} \text{ 2018} \qquad \textbf{(D)} \text{ 2019} \qquad \textbf{(E)} \text{ 2020}</math>
 
<math>\textbf{(A)} \text{ 2016} \qquad \textbf{(B)} \text{ 2017} \qquad \textbf{(C)} \text{ 2018} \qquad \textbf{(D)} \text{ 2019} \qquad \textbf{(E)} \text{ 2020}</math>
 +
 +
==Solution==
 +
<math>f\left(n\right) = f\left(n - 1\right) - f\left(n - 2\right) + n</math>
 +
 +
<math>= \left(f\left(n - 2\right) - f\left(n - 3\right) + n - 1\right) - f\left(n - 2\right) + n</math>
 +
 +
<math>= 2n - 1 - f\left(n - 3\right)</math>
 +
 +
<math>= 2n - 1 - \left(2\left(n - 3\right) - 1 - f\left(n - 6\right)\right)</math>
 +
 +
<math>= f\left(n - 6\right) + 6</math>
 +
 +
Thus, <math>f\left(2018\right) = 2016 + f\left(2\right) = 2017</math>. <math>\boxed{B}</math>

Revision as of 15:16, 16 February 2018

Problem

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)} \text{ 2016} \qquad \textbf{(B)} \text{ 2017} \qquad \textbf{(C)} \text{ 2018} \qquad \textbf{(D)} \text{ 2019} \qquad \textbf{(E)} \text{ 2020}$

Solution

$f\left(n\right) = f\left(n - 1\right) - f\left(n - 2\right) + n$

$= \left(f\left(n - 2\right) - f\left(n - 3\right) + n - 1\right) - f\left(n - 2\right) + n$

$= 2n - 1 - f\left(n - 3\right)$

$= 2n - 1 - \left(2\left(n - 3\right) - 1 - f\left(n - 6\right)\right)$

$= f\left(n - 6\right) + 6$

Thus, $f\left(2018\right) = 2016 + f\left(2\right) = 2017$. $\boxed{B}$