Let be a function satisfying
Find the number of integers such that
See Part 2 if you enjoyed this problem! :D
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
You really need to restrict to positive integers here, since f ( 0 ) = 0 can be deduced from the equations (and there are a lot of negative integers that satisfy f ( n ) = 2 n as well...)
Clearly f (when restricted to nonnegative integers) is just the function that switches the 1 s and 2 s in the ternary expansion of an integer. It's not hard to see that f ( n ) = 2 n if and only if n 's ternary expansion consists of only 0 s and 1 s. The restriction on n means that it has at most 7 ternary digits. So the total number of such nonnegative n is 2 7 , or 2 7 − 1 = 1 2 7 if we restrict to positive integers.