Given a strictly increasing function f : N → N which satisfies
f ( f ( f ( x ) ) ) = 4 x
Find f ( 3 1 7 1 ) .
Bonus : Generalize this for any strictly increasing function which satisfies f : N → N and f ( f ( ⋯ f ( x ) ) ) = ( n + 1 ) x , where the function is iterated n times.
Notation : N denotes the set of natural numbers .
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.
lakas ni kahayon
Pretty much my solution as well
First, get the base case down. The function must go as follows:
Then:
In some cases, as with f(4) and f(8), there will be "gaps." For example, using this method alone, f(5) will still be unknown. To fill the gaps, we notice that in some cases, the jump in the domain is the same as the jump the the range. In the above example, 12-8 = 8-4 = 4. This is easy to fill because we know the function is strictly increasing. Therefore f ( 5 ) = 9 , f ( 6 ) = 1 0 , and f ( 7 ) = 1 1 .
Then there are the gaps where the domain jump is different than the range jump. E.g. f ( 1 2 ) = 1 6 and f ( 1 6 ) = 3 2 . 3 2 − 1 6 = 1 6 and 1 6 − 1 2 = 4 . We can fill these gaps as well by noticing that the second inverse is already defined. E.g. f − 1 ( f − 1 ( 1 3 ) ) = 5 so f ( 1 3 ) = 4 ∗ 5 = 2 0 . (As it so happens, these are evenly spaced by 4's.)
Thus the following Python code solves the problem:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Which prints:
1 |
|
The wonders of computer programming
Solution in python
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Induction - Functional Equations
(Warning: Very rough outline!)
We will prove by induction that
For 4 n ≤ x ≤ 3 ( 4 n ) , f ( x ) = x + 4 n ,
For 3 ( 4 n ) ≤ x ≤ 4 n + 1 , f ( x ) = 4 ( x − 2 ( 4 n ) .
We cannot have f ( 1 ) = 1 , as this implies f ( f ( f ( 1 ) ) ) = 1 = 4 . Similarly, if f ( 1 ) = 3 , then f ( 2 ) ≥ 4 , f ( 3 ) ≥ 5 , f ( 4 ) ≥ 6 , f ( 5 ) ≥ 7 , which implies f ( f ( f ( 1 ) ) ) = f ( f ( 3 ) ) = f ( 5 ) = 4 , creating a contradiction. This then forces f ( 1 ) = 2 , f ( f ( 2 ) ) = 4 . Similarly, we can prove that if f ( 2 ) = 4 , then f ( 4 ) = 4 , implying f ( f ( f ( 4 ) ) ) = 4 = 1 6 , contradiction. This then forces f ( 2 ) = 3 , f ( 3 ) = 4 . Also, f ( f ( f ( 2 ) ) ) = f ( f ( 3 ) ) = f ( 4 ) = 8 .
Thus, f ( 1 ) = 2 , f ( 2 ) = 3 , f ( 3 ) = 4 , f ( 4 ) = 8 . Thus we have proved the hypothesis above for n = 0 .
Consider when x = 2 ( 4 n ) + a where 0 ≤ a ≤ 4 n . Then, we have
f ( f ( f ( x ) ) ) = f ( f ( x + 4 n ) ) = f ( 4 a + 4 n + 1 ) = 4 a + 2 ( 4 n + 1 )
(The substitutions were based on the fact that 4 n ≤ x ≤ 3 ( 4 n ) and 3 ( 4 n ) ≤ x + 4 n ≤ 4 n + 1 )
This proves that f ( x ) = x + 4 n + 1 for all 4 n + 1 ≤ x ≤ 2 ( 4 n + 1 ) (The other small stuff can be proved by stating f is increasing)
Consider when x = 3 ( 4 n ) + a where 0 ≤ a ≤ 4 n . Then, we have
f ( f ( f ( x ) ) ) = f ( f ( f ( 3 ( 4 n ) + a ) ) ) = f ( f ( 4 a + 4 n + 1 ) ) = f ( 4 a + 2 ( 4 n + 1 ) ) = 4 a + 3 ( 4 n + 1 ) .
(The substitutions were based on the fact that 3 ( 4 n ) ≤ x ≤ 3 ( 4 n + 1 ) and the result above)
This proves that f ( x ) = x + 4 n + 1 for all 2 ( 4 n + 1 ) ≤ x ≤ 3 ( 4 n + 1 ) (The other small stuff can be proved by stating f is increasing)
Now, consider x = a − 2 ( 4 n + 1 ) for 3 ( 4 n + 1 ) ≤ a ≤ 4 n + 2
Now, f ( f ( f ( x ) ) ) = f ( f ( f ( a − 2 ( 4 n + 1 ) ) ) ) = f ( f ( a − 4 n + 1 ) ) = f ( a ) = 4 ( a − 2 ( 4 n + 1 ) )
(The substitutions were based on the fact that 4 n + 1 ≤ a − 2 ( 4 n + 1 ) ≤ a − 4 n + 1 ≤ 4 n + 1 and the result above)
Thus, our proof is complete.We need only to substitute x = 3 1 7 1 . Since 3 ( 4 5 ) ≤ 3 1 7 1 ≤ 4 6 , our answer is
4 ( 3 1 7 1 − 2 ( 4 5 ) ) = 4 ( 3 1 7 1 − 2 0 4 8 ) = 4 4 9 2