MathDB
sum of distances, 5 digit numbers - All-Russian MO 2004 Regional (R4) 11.6

Source:

September 27, 2024
number theorycombinatoricsDigits

Problem Statement

Let us call the distance between the numbers a1a2a3a4a5\overline{a_1a_2a_3a_4a_5} and b1b2b3b4b5\overline{b_1b_2b_3b_4b_5} the maximum ii for which aibia_i \ne b_i. All five-digit numbers are written out one after another in some order. What is the minimum possible sum of distances between adjacent numbers?