Problem

Source: Cono Sur Olympiad, 1995, Problem #6

Tags: floor function, function, modular arithmetic, inequalities, number theory, relatively prime



Let $n$ be a natural number and $f(n) = 2n - 1995 \lfloor \frac{n}{1000} \rfloor$($\lfloor$ $\rfloor$ denotes the floor function). 1. Show that if for some integer $r$: $f(f(f...f(n)...))=1995$ (where the function $f$ is applied $r$ times), then $n$ is multiple of $1995$. 2. Show that if $n$ is multiple of 1995, then there exists r such that:$f(f(f...f(n)...))=1995$ (where the function $f$ is applied $r$ times). Determine $r$ if $n=1995.500=997500$