0

Suppose $A>B>C>D$ be four unit digit natural number and $P_1=ABCD$(descending digits) and $Q_1=DCBA$ (ascending digits) and $R_1=P_1-Q_1$, according to Kaprekar $R_1$ could be 6174. If not then go to the second level by constructing $P_2$ and $Q_2$ permuting the digits of $R_1$, find $R_2=P_2-Q_2$, then $R_2$ could be 6174, if not go till $n-$th level, in this process $R_n$ will be 6174. Eventually $R_n$ will be 6174. The magic number 6174 is a unique four digit number called Kaprekar constant.

The question is how many first level 4-digit numbers $P_1$ are possible that give $P_1-Q_1=6174.$

For Kaprekar's claim, you may see:

Mysterious number $6174$

Edit: Let us allow A=B or C=D or both that means ABCD are weakly descending ( As remarked by @Christian Blatter in his answer below.

Z Ahmed
  • 43,235

1 Answers1

1

Let $9\geq a\geq b\geq c\geq d\geq0$ be the descending digits of $p_1$. Then $0\leq d\leq c\leq b\leq a$ are the ascending digits of $q_1$. We want that $$p_1-q_1-6174=9 (111 a + 10 b - 10 c - 111 d-686)=0\ .$$ Letting $$a-d=:u\in[0\,..\,9],\qquad b-c=:v\in[0\,..\,9]$$ this means that $$111u+10v=686\ .$$ It follows that $u=6$, $\>v=2$. This implies $$(a,d)\in\bigl\{(6,0), (7,1), (8,2), (9,3)\bigr\}\ .$$ For each of these allowed pairs $(a,d)$ with $a-d=6$ we have $5$ allowed pairs $(b,c)$ with $$a\geq b,\qquad b-2=c\geq d\ .\tag{1}$$ It follows that there are $4\cdot 5=20$ four digit numbers with weakly descending digits satisfying $p_1-q_1=6174$. When the original digits have to descend strongly then we get only $4\cdot 3=12$ admissible solutions, since $(1)$ has to be replaced by $$a> b,\qquad b-2=c> d\ .$$