Maths Olympiad Prep

Library / /315 of 520

Number theory Difficulty 5.4 AIME, harder Find the answer

For nN+n \in \mathbf{N}_{+}, define
S(n)=[n10[18n]]+10(n10[in][n10[1/Bn]]), S(n)=\left[\frac{n}{10^{[18 n]}}\right]+10\left(n-10^{[i \mid n]}\left[\frac{n}{10^{\left[1 / B^{n}\right]}}\right]\right),

where [x][x] denotes the greatest integer not exceeding the real number xx. Then, among 1,2,,20121,2, \cdots, 2012, the number of positive integers nn that satisfy S(S(n))=nS(S(n))=n is

A number or a short expression. Spacing and $ signs are ignored.

Solution

6. 108.

Let t=10[lgn]t=10^{[\lg n]}. Then
S(n)=[nt]+10(nt[nt]) S(n)=\left[\frac{n}{t}\right]+10\left(n-t\left[\frac{n}{t}\right]\right) \text {. }

Notice that, nt[nt]n-t\left[\frac{n}{t}\right] is the remainder of nn modulo tt, and [nt]\left[\frac{n}{t}\right] is the first digit of nn.
We will discuss the cases below.
(1) If nn is a one-digit number, all satisfy the requirement, totaling 9.
(2) If n=xy,S(n)=yx,S(S(n))=xyn=\overline{x y}, S(n)=\overline{y x}, S(S(n))=\overline{x y}, totaling 81 (excluding those with y=0y=0).
(3) If n=xyz,S(n)=yzx,S(S(n))=zxyn=\overline{x y z}, S(n)=\overline{y z x}, S(S(n))=\overline{z x y}, thus, x=y=zx=y=z, totaling 9.
(4) If n=xyzw,S(S(n))=zwxyn=\overline{x y z w}, S(S(n))=\overline{z w x y}, thus, w=y,z=xw=y, z=x, totaling 9.
Therefore, the number of nn that satisfy the requirement is 108.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.