To solve the problem, we need to find all positive integers n such that the decimal representation of n, denoted as amam−1…a1, satisfies the equation:
n=(am+1)(am−1+1)⋯(a1+1)
1. **Express n in terms of its digits:**
n=i=1∑m10i−1ai
where ai are the digits of n.
2. Set up the given equation:
i=1∑m10i−1ai=i=1∏m(ai+1)
3. Rearrange the equation:
i=2∑m(10i−1−j=1∏i−1(aj+1))ai=1
This equation implies that all summands are nonnegative, and one of them must be 1 while the others are 0.
4. **Consider the case m=2:**
n=10a2+a1
n=(a2+1)(a1+1)
We need to find a1 and a2 such that:
10a2+a1=(a2+1)(a1+1)
Expanding and simplifying:
10a2+a1=a2a1+a2+a1+1
10a2=a2a1+a2+1
9a2=a2a1+1
9a2−1=a2a1
a1=a29a2−1
For a1 to be an integer, 9a2−1 must be divisible by a2. Testing values of a2 from 1 to 9, we find:
a2=2⟹a1=29⋅2−1=218−1=217(not an integer)
a2=1⟹a1=19⋅1−1=8
Thus, n=10⋅1+8=18.
5. **Consider the case m≥3:**
If m≥3, then:
j=1∏m−1(aj+1)=10m−1
This implies:
a1=a2=⋯=am−1=9
However, this is impossible because the product of digits ai+1 would be too large to match the sum of the digits multiplied by powers of 10.
Therefore, the only solution is when m=2 and n=18.
The final answer is 18.