정수론 · Kaprekar 1949Number Theory · Kaprekar 1949

카프레카 상수Kaprekar's Constant

아무 네 자리 수나 하나 고릅니다. 자릿수를 큰 순서로 늘어놓은 수에서 작은 순서로 늘어놓은 수를 뺍니다. 나온 답으로 같은 일을 또 합니다. 그러면 7번 안에 반드시 6174에 도착하고, 거기서 영원히 멈춥니다. 콜라츠 추측과 달리 이건 증명됩니다. Pick any four-digit number. Write its digits in descending order, write them in ascending order, and subtract. Do the same to the answer. Within seven steps you always land on 6174, and there you stay forever. Unlike the Collatz conjecture, this one can be proved.

6174 495 유한 확인으로 증명Proved by a finite check

규칙은 세 줄The whole rule is three lines

네 자리 수 하나를 잡고, 이렇게 합니다.

Take a four-digit number and do this.

이제 3087로 같은 일을 반복합니다.

Now repeat the same thing on 3087.

1234 → 3087 → 8352 → 6174

6174에 닿으면 더는 움직이지 않습니다. 7641 − 1467 = 6174, 자기 자신으로 돌아오기 때문입니다. 이 수를 카프레카 상수라고 부릅니다.

Once at 6174 nothing moves again: 7641 − 1467 = 6174, it maps to itself. That number is Kaprekar's constant.

두 가지 약속. 1111처럼 네 자리가 모두 같은 수는 뺄셈이 0이 되어 멈추므로 빼고 셉니다. 그리고 계산 도중 앞자리에 0이 생겨도 자릿수는 그대로 넷으로 둡니다. 1000 → 0999처럼요. Two ground rules. Numbers whose digits are all the same, like 1111, subtract to 0 and stop, so they are left out. And when a leading zero appears mid-way, keep the number four digits long: 1000 → 0999.

🔢 직접 돌려 보기🔢 Run it yourself

아무 수나 넣어 보세요. 세 자리는 495, 네 자리는 6174에서 멈춥니다Try any number. Three digits stop at 495, four digits at 6174
걸린 걸음Steps taken
–
도착한 수Landed on
–

예외는 정말 하나도 없을까Are there really no exceptions?

몇 개 해보고 "되네" 하는 건 증명이 아닙니다. 다행히 이 문제는 후보가 유한합니다. 네 자리 수는 0000부터 9999까지 만 개뿐이고, 자릿수가 모두 같은 열 개를 빼면 9990개입니다. 전부 돌려 보면 됩니다.

Trying a few and saying "it works" is not a proof. Happily, here the candidates are finite. There are only ten thousand four-digit strings from 0000 to 9999, and dropping the ten with all digits equal leaves 9990. So run them all.

📊 전부 세어 보기📊 Count every one of them

가능한 모든 시작 수를 돌려 걸음 수별로 세었습니다. 오른쪽 끝이 최악의 경우입니다Every possible starting number, counted by how many steps it took. The right edge is the worst case
확인한 시작 수Starts checked
–
최대 걸음Worst case
–
도달 못 한 수Never arrived
–

왜 그런지 증명해 봅시다Now let's prove it

만 개를 다 돌려 본 건 증명이 맞습니다. 다만 손으로는 못 합니다. 그런데 이 문제에는 훨씬 짧은 길이 있습니다. 한 걸음만 지나면 남는 후보가 몇십 개로 줄어듭니다.

Running all ten thousand is a valid proof, just not one a person can do by hand. But there is a much shorter road: after a single step, only a few dozen candidates are left.

① 뺄셈은 자릿수를 기억하지 못한다① The subtraction forgets the digits

세 자리부터 봅시다. 자릿수를 큰 순서로 a ≥ b ≥ c라고 두면, 두 수는 abc와 cba입니다. 빼면 이렇게 됩니다.

Start with three digits. Sorted descending they are a ≥ b ≥ c, so the two numbers are abc and cba. Subtracting:

(100a + 10b + c) − (100c + 10b + a) = 99 (a − c)

가운데 자리 b가 완전히 사라졌습니다. 결과는 오직 가장 큰 자리와 가장 작은 자리의 차이 하나로 정해집니다. 그 차이는 1부터 9까지뿐이고요(0이면 세 자리가 다 같은 수라 제외했습니다). 그러니 첫 걸음을 밟는 순간, 남은 수는 딱 아홉 개입니다.

The middle digit b vanished entirely. The result depends on nothing but the gap between the largest and smallest digit, and that gap runs only from 1 to 9 (a gap of 0 means all three digits are equal, which we excluded). So the moment the first step is taken, only nine numbers remain.

② 아홉 개를 전부 적어 봅시다② Write down all nine

아홉 개가 각각 어디로 가는지 적으면 세 자리 증명은 그것으로 끝납니다.

Write where each of the nine goes, and the three-digit proof is finished right there.

아홉 개가 한 줄로 이어져 495로 흘러들고, 495는 자기 자신으로 갑니다. 빠져나갈 곳도, 맴돌 고리도 없습니다. 첫 걸음까지 세면 세 자리는 최대 6걸음입니다.

The nine form a single line that drains into 495, and 495 maps to itself. There is nowhere to escape to and no loop to get stuck in. Counting the first step, three digits take at most six steps.

③ 네 자리도 똑같은 방법③ Four digits, same method

자릿수를 a ≥ b ≥ c ≥ d로 두고 같은 뺄셈을 하면 이렇게 됩니다.

Sort the digits as a ≥ b ≥ c ≥ d and do the same subtraction:

(1000a + 100b + 10c + d) − (1000d + 100c + 10b + a) = 999 (a − d) + 90 (b − c)

이번에도 자릿수 넷이 통째로 사라지고 차이 두 개만 남습니다. 큰끝과 작은끝의 차이 p = a − d, 가운데 둘의 차이 q = b − c입니다. p는 1부터 9까지고, q는 p보다 클 수 없습니다. a − d = (a − b) + (b − c) + (c − d)인데 앞뒤 두 항이 0 이상이니까요.

Again the four digits collapse into two gaps: the outer gap p = a − d and the inner gap q = b − c. Here p runs from 1 to 9, and q can never exceed p, because a − d = (a − b) + (b − c) + (c − d) and the outer two terms are never negative.

그런 (p, q) 쌍을 세어 보면 54가지입니다. 만 개짜리 문제가 54개짜리 문제로 줄었습니다.

Counting those (p, q) pairs gives 54. A problem about ten thousand numbers just became a problem about 54.

④ 54개를 전부 적어 봅시다④ Write down all 54

아래가 그 54개 전부입니다. 가로는 q, 세로는 p이고, 각 칸의 작은 숫자는 거기서 6174까지 남은 걸음입니다.

Below are all 54. Rows are p, columns are q, and the small number in each cell is how many steps remain from there to 6174.

6174 (고정점)6174 (fixed point) 색이 진할수록 남은 걸음이 많음Darker means more steps remain

남은 걸음의 최댓값이 6입니다. 첫 걸음을 더하면 7이고요. 54칸 어디에도 6174로 안 가는 칸은 없고, 서로 맴도는 고리도 없습니다. 증명 끝입니다.

The largest remaining count is 6. Add the first step and it is 7. No cell among the 54 fails to reach 6174, and none of them loop. That is the proof.

증명이 한 일은 이것뿐입니다. 무한해 보이던 문제를 유한한 표 한 장으로 접었습니다. 정렬한 뒤의 뺄셈이 자릿수를 잊어버리고 차이 두 개만 남긴다는 것, 그 한 가지 관찰이 만 개를 54개로 줄였습니다. That is all the proof did. It folded a problem that looked endless into one finite table. A single observation, that sorting then subtracting forgets the digits and keeps only two gaps, cut ten thousand cases down to 54.

콜라츠는 왜 아직도 안 풀렸을까So why is Collatz still open?

두 문제는 겉모습이 닮았습니다. 규칙 한 줄을 반복하면 한 점으로 빨려든다는 것이죠. 그런데 한쪽은 표 한 장으로 끝났고, 다른 쪽은 90년째 미해결입니다. 차이는 도망갈 곳이 있느냐입니다.

The two problems look alike: repeat a one-line rule and everything drains to a single point. Yet one ends with a table and the other has been open for ninety years. The difference is whether there is anywhere to run.

카프레카의 규칙은 네 자리 수를 네 자리 수로만 보냅니다. 값이 커질 수가 없어요. 게다가 정렬 때문에 차이 두 개로 한 번 더 접힙니다. 상자가 유한하니 결국 다 확인할 수 있습니다.

Kaprekar's rule sends a four-digit number to another four-digit number. It cannot grow. And sorting folds it once more, down to two gaps. The box is finite, so everything in it can be checked.

반면 3n + 1은 값을 얼마든지 키울 수 있습니다. 27로 시작해도 9232까지 치솟죠. 상자가 없으니 전수 조사가 원리적으로 불가능하고, 지금까지 확인한 3×1020까지는 그저 아직 반례를 못 찾았다는 뜻일 뿐입니다.

By contrast 3n + 1 can grow without any ceiling: even a start of 27 spikes to 9232. With no box, checking everything is impossible in principle, and all the numbers verified so far, up to 3×1020, only mean no counterexample has turned up yet.

한 줄로 줄이면: 카프레카가 쉬운 이유는 6174가 특별해서가 아니라, 가능한 경우가 셀 수 있게 갇혀 있기 때문입니다. 수학에서 증명이 되느냐 마느냐는 종종 "재주"가 아니라 상자가 있느냐로 갈립니다. In one line: Kaprekar is easy not because 6174 is special, but because the possibilities are penned into a countable box. Whether something can be proved often turns not on cleverness but on whether there is a box.