S ( n ) = ⌊ 1 0 ⌊ l g n ⌋ n ⌋ + 1 0 ( n − 1 0 ⌊ l g n ⌋ ⌊ 1 0 ⌊ l g n ⌋ n ⌋ )
Let S ( n ) be defined as above for all positive integers n . Find the number of n ≤ 5 0 0 0 such that S ( S ( n ) ) = n .
Notations:
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 have said that the x j cannot be equal to 0 too early. While identifying the function S in part 1, the only thing we have for certain is that x k = 0 . We can then show that S moves the first digit of n to the end. This means that, if x k − 1 = 0 , then S ( n ) will be a number with fewer digits than n , and your formula for S ( S ( n ) ) will be incorrect.
However, moving on to part 2, if x k − 1 = 0 then S ( S ( n ) ) will not be equal to n . Thus, for S ( S ( n ) ) = n , we must have both x k and x k − 1 nonzero, which then forces all the other digits to be nonzero as well. Your count of solutions then proceeds as you indicate.
Problem Loading...
Note Loading...
Set Loading...
1. Suppose n = x k ⋯ x 1 x 0 ,here x i ∈ { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } for i = 0 , 1 , ⋯ , k .
Then 1 0 k < n < 1 0 k + 1 ,which implies k < l g n < k + 1 .Thus ⌊ l g n ⌋ = k .
Now easy to see ⌊ 1 0 ⌊ l g n ⌋ n ⌋ = x k .
So S ( n ) = x k + 1 0 ( x k ⋯ x 1 x 0 − x k k − 1 0 ⋯ 0 0 ) = x k − 1 ⋯ x 1 x 0 x k ,
and S ( S ( n ) ) = x k − 2 ⋯ x 1 x 0 x k − 1 x k .
2. Apply the result above. If n has the digit 0 , then n cannot equal to S ( S ( n ) ) . (You can check it in Sir. Mark Hennings's comment below.)
In the following statement, a , b , c , d are positive integers less than 10, ∣ A ∣ stands for the number of elements in set A .
S ( S ( a ) ) = a ⟶ A 1 = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } , ∣ A 1 ∣ = 9
S ( S ( a b ) ) = a b ⟶ A 2 = { 1 1 , 1 2 , ⋯ , 1 9 ; 2 1 , 2 2 , ⋯ , 2 9 ; ⋯ ; 9 1 , 9 2 , ⋯ , 9 9 } , ∣ A 2 ∣ = 8 1
S ( S ( a b c ) ) = c a b ⟶ A 3 = { 1 1 1 , 2 2 2 , ⋯ , 9 9 9 } , ∣ A 3 ∣ = 9
S ( S ( a b c d ) ) = c d a b ⟶ A 4 = { 1 1 1 1 , 1 2 1 2 , 1 3 1 3 , ⋯ , 1 9 1 9 ; 2 1 2 1 , 2 2 2 2 , 2 3 2 3 , ⋯ , 2 9 2 9 ; ⋯ ; 4 1 4 1 , 4 2 4 2 , ⋯ , 4 9 4 9 } , ∣ A 4 ∣ = 3 6
So the answer is i = 1 ∑ 4 ∣ A i ∣ = 1 3 5 .