MathDB
Permutation of digits

Source: 2016 AIME I #8

March 4, 2016
AMCAIMEAIME I2016 AIME Ipermutations

Problem Statement

For a permutation p=(a1,a2,,a9)p = (a_1,a_2,\ldots,a_9) of the digits 1,2,,91,2,\ldots,9, let s(p)s(p) denote the sum of the three 33-digit numbers a1a2a3a_1a_2a_3, a4a5a6a_4a_5a_6, and a7a8a9a_7a_8a_9. Let mm be the minimum value of s(p)s(p) subject to the condition that the units digit of s(p)s(p) is 00. Let nn denote the number of permutations pp with s(p)=ms(p) = m. Find mn|m - n|.