3

Given the function,

$$f(n)= \begin{cases} \ n-3 \quad \text{ if }\quad n\ge1000\\ \\ f (f (n+5)) \quad\text{ if } \quad n<1000 \end{cases} $$

What is the value of $f (83)-f (84) $?


One of my friends gave me this problem. I tried to find a pattern for the numbers but couldn't. I programmed the recursive function on C++ and got $1$ as the answer.

srswat
  • 303

1 Answers1

2

Hint: Prove by induction that $f(n)=997+(n \bmod 2)$ for $n<1000$. (Actually, for $n\le 1001$.)

lhf
  • 216,483