11

Let $f$ be a function from the positive integers into the positive integers and which satisfies $f(n + 1) > f(n)$ and $f(f(n)) = (f \circ f) (n) = 3n$ for all $n$. Find $f(100)$.

This is one of the questions we presented in one session to contest preparation PUTNAM. It turns out that I can't get from the problem. Could someone just give me a hint?

Raj
  • 964
  • @PaulSundheim: "Let f be a function from the positive integers into the positive integers." – Ron Gordon Sep 20 '15 at 23:39
  • $f(1)=1\Rightarrow f(f(1)=f(1)=1=3$ so $f(1)>1$ is a first step (or hint). – Moya Sep 20 '15 at 23:39
  • Also, $f(f(f(f(n)))=f(f(3n))=9n$ and proceed inductively maybe? – Moya Sep 20 '15 at 23:42
  • 2
    It's not clear at all what you are trying to say. Could you develop a bit? –  Sep 20 '15 at 23:46
  • 3
    I think Moya's first hint was trying to say that $f$ can't have any fixed points: if $f(n) = n$, then $f(f(n)) = n \neq 3n$, hence $f(1) > 1$. – Rob Arthan Sep 20 '15 at 23:49
  • 1
    Yes sorry I'm about to run out the door and saw this, so I'll try to expand before I go. @RobArthan explained what I meant by the first hint. You can show by similar logic that $f(1)=2$. The second hint/idea was to try to get a reduction going. $f(100)=f(99+1)>f(99)=f(3(33))=f(f(f(33)))$ etc. I don't know if it would work, but it's an idea. – Moya Sep 20 '15 at 23:51
  • 3
    $f(1)$ has to be $2$, since $3=f(f(1))>f(1)$ and $f(1)\ne1$. Thus, $f(2)=f(f(1))=3$. $f(3)=f(f(2))=6$. $f(6)=f(f(3))=9$. Since $f$ is increasing, $f(4)$ and $f(5)$ are $7$ and $8$ respectively. – Akiva Weinberger Sep 20 '15 at 23:52
  • Which gives us enough data to find it on the OEIS: http://oeis.org/search?q=2%2C3%2C6%2C7%2C8%2C9%2C12%2C15&sort=&language=english&go=Search (probably not much use in a contest $\ddot{\smile}$). – Rob Arthan Sep 21 '15 at 00:13
  • 1
    @RobArthan "Numbers whose base 3 representation starts with 2 or ends with 0." Wow, I wonder why that is? (By the way, $181=20201_3$.) – Akiva Weinberger Sep 21 '15 at 00:37

3 Answers3

13

The function is clearly increasing, so $f(99)<f(100)<f(102)$. Since $f(99)=f(f(f(f(f(11)))))$, it makes sense that we'd want to know $f(11)$. Also, $f(102)=f(f(f(34)))$, so we want $f(34)$. After a while, one arrives at the following solution:

$f(1)\ne1$, since $f(1)=1$ implies $3=f(f(1))=f(1)=1$. Thus, $1<f(1)$. Since the function is increasing, we have $f(1)<f(f(1))=3$. Thus, $1<f(1)<3$, and $f(1)=2$.

$f(2)=f(f(1))=3$, and $f(3)=f(f(2))=6$. $f(6)=f(f(3))=9$. Since the function is increasing, this implies $f(4)=7$ and $f(5)=8$.

$f(7)=f(f(4))=12$. $f(9)=f(f(6))=18$, and $f(12)=f(f(7))=21$. Again, due to the increasing nature of $f$, we have $f(10)=19$ and $f(11)=20$.

$f(21)=f(f(12))=36$. $f(33)=f(f(20))=60$, and $f(36)=f(f(12))=63$. Thus, due to $f$ being increasing, $f(34)=61$ and $f(35)=62$. $f(60)=f(f(33))=99$, and $f(61)=f(f(34))=102$.

$f(99)=f(f(60))=180$ and $f(102)=f(f(61))=183$. Since $f$ is increasing, $f(100)=181$ and $f(101)=182$.

Thus: $$f(100)=181$$

4

In general:

  • If the base 3 representation of $n$ starts with a $1$, $f(n)$ switches it to $2$;

  • If the base 3 representation of $n$ starts with a $2$, $f(n)$ switches it to $1$ and multiplies by $3$.

Given this, we simply write $100 = 81 + 9 + 9 + 1 = 10201_3$, so that $$ f(100) = f(10201_3) = 20201_3 = \boxed{181}. $$


Proof of this description of $\boldsymbol{f}$

It is clear that $f$, when defined this way, satisfies $f(n+1) > f(n)$ and $f(f(n)) = 3n$ for all $n$. So if you are assuming $f(100)$ is completely determined by these conditions (given the wording of the problem), you can stop here.

Otherwise, we need to prove that the $f$ we defined is the only possible $f$. So fix any $g$ satisfying $g(g(n)) = 3n$ and $g(n+1) > g(n)$ for all $n$; we will prove that $g(n) = f(n)$ for all $n$, where $f(n)$ is as we defined.

First, note the following: (1) $g$ is surjective onto multiples of three (since $g(g(n)) = 3n$); (2) $g(3n) = g(g(g(n))) = 3g(n)$; (3) $f$ is surjective onto multiples of three; (4) $f(3n) = 3f(n)$; and (5) $f(n+1) - f(n) \in \{1, 3\}$ for all $n \ge 1$. (3) and (4) are justified by the same reasoning as (1) and (2); (5) is the most important and follows from our definition of $f$, if you do cases on the base $3$ representation of $n$.

We proceed by strong induction. For the base case, as others have observed, $1 < g(1) < 3$ implies $g(1) = 2$ and $g(2) = 3$, i.e. $g(1_3) = 2_3$ and $g(2_3) = 10_3$, so $g$ agrees with $f$.

For the inductive step, fix $k \ge 1$, suppose that $g(i) = f(i)$ for $i \le k+1$, and consider $g(3k), g(3k+1), g(3k+2), g(3k+3)$. We have $g(3k) = 3g(k) = 3f(k)$, and $g(3k+3) = 3f(k+1)$. By (5), there are two cases:

  • If $f(k+1) - f(k) = 1$, for $g$ to be strictly increasing we must pick $g(3k+1) = 3f(k) + 1$, and $g(3k+2) = 3f(k) + 2$. In particular $g(3k+1) = f(3k+1), g(3k+2) = f(3k+2)$.

  • If on the other hand $f(k+1) - f(k) = 3$, for $g$ to be surjective onto multiples of $3$ we must pick $g(3k+1) = 3f(k) + 3$, $g(3k+2) = 3f(k) + 6$. In particular $g(3k+1) = f(3k+1), g(3k+2) = f(3k+2)$.

So this completes the induction.

3

As per Akiva Weinberger's comment, we have that $f(1) = 2, f(3) = 6$ and $f(6)=9$. As $f$ is increasing, this forces $f(4)=7$ and $f(5)=8$.

As $f(7)=f(f(4))=3\cdot4=12$, we have $f(12)=3\cdot7=21$. Similarly, $f(9)=f(f(6))=18$. So we have: $$f(9)=18<f(10)<f(11)<f(12)=21$$ giving $f(10)=19, f(11)=20$.

Then $f(20)=f(f(11))=33$ and $f(21)=f(f(12))=36$

So $$f(33)=f(f(20))=60<f(34)<f(35)<f(36)=f(f(21))=63$$ Which forces $f(34)=61$.

So, $f(60)=f(f(33))=99$ and $f(61)=f(f(34))=102$.

Finally, $$f(99)=f(f(60))=180<f(100)<f(101)<f(102)=f(f(61))=183$$ and so $$f(100) = 181$$

The main idea used in this solution is that if for some $k$, $f(k+1) = f(k)+1$, then $$f(3k)=f(f(f(k)))=3f(k)<f(3k+1)<f(3k+2)<f(3k+3)=f(f(f(k+1)))=3f(k+1) =3(f(k)+1) = 3f(k) +3$$ so $f(3k+1)=f(3k)+1$ and $f(3k+2)=f(3k)+2$. As a direct corollary, if we can apply this to $k$, we can also apply it to $k'=3k, 3k+1$ or $3k+2$.

Ori
  • 398
  • 1
  • 3
  • 13