Lynne chooses four distinct digits from 1 to 9 and arranges them to form the 24 possible four-digit numbers. These 24 numbers are added together giving the result $N$. For all possible choices of the four distinct digits, what is the largest sum of the distinct prime factors of $N$ ?
(A) 157
(B) 148
(C) 127
(D) 146
(E) 124
Let $a, b, c$, and $d$ be the four distinct digits that are chosen from the digits 1 to 9 .

These four digits can be arranged in 24 different ways to form 24 distinct four-digit numbers. Consider breaking the solution up into the 3 steps that follow.

Step 1: Determine how many times each of the digits $a, b, c, d$ appears as thousands, hundreds, tens, and units (ones) digits among the 24 four-digit numbers

If one of the 24 four-digit numbers has thousands digit equal to $a$, then the remaining three digits can be arranged in 6 ways: $b c d, b d c, c b d, c d b, d b c$, and $d c b$.

That is, there are exactly 6 four-digit numbers whose thousands digit is $a$.

If the thousands digit of the four-digit number is $b$, then the remaining three digits can again be arranged in 6 ways to give 6 different four-digit numbers whose thousands digit is $b$.

Similarly, there are 6 four-digit numbers whose thousands digit is $c$ and 6 four-digit numbers whose thousands digit is $d$.

The above reasoning can be used to explain why there are also 6 four-digit numbers whose hundreds digit is $a, 6$ four-digit numbers whose hundreds digit is $b, 6$ four-digit numbers whose hundreds digit is $c$, and 6 four-digit numbers whose hundreds digit is $d$.

In fact, we can extend this reasoning to conclude that among the 24 four-digit numbers, each of the digits $a, b, c, d$, appears exactly 6 times as the thousands digit, 6 times as the hundreds digit, 6 times as the tens digit, and 6 times as the units digit.

Step 2: Determine $N$, the sum of the 24 four-digit numbers

Since each of the digits $a, b, c, d$ appear 6 times as the units digit of the 24 four-digit numbers, then the sum of the units digits of the 24 four-digit numbers is $6 a+6 b+6 c+6 d$ or $6 \times(a+b+c+d)$. Similarly, since each of the digits $a, b, c, d$ appear 6 times as the tens digit of the 24 four-digit numbers, then the sum of the tens digits of the 24 four-digit numbers is $10 \times 6 \times(a+b+c+d)$. Continuing in this way for the hundreds digits and the thousands digits, we get

$$
\begin{aligned}
N= & 1000 \times 6 \times(a+b+c+d)+100 \times 6 \times(a+b+c+d)+10 \times 6 \times(a+b+c+d) \\
& +6 \times(a+b+c+d) \\
= & 6000(a+b+c+d)+600(a+b+c+d)+60(a+b+c+d)+6(a+b+c+d)
\end{aligned}
$$

If we let $s=a+b+c+d$, then $N=6000 s+600 s+60 s+6 s=6666 s$.

Step 3: Determine the largest sum of the distinct prime factors of $N=6666 \mathrm{~s}$

Writing 6666 as a product of prime numbers, we get $6666=6 \times 1111=2 \times 3 \times 11 \times 101$.

So then $N=2 \times 3 \times 11 \times 101 \times s$ and thus the sum of the distinct prime factors of $N$ is $2+3+11+101$ added to the prime factors of $s$ which are distinct from 2,3,11, and 101 .

That is, to determine the largest sum of the distinct prime factors of $N$, we need to find the largest possible sum of the prime factors of $s$ which are not equal to $2,3,11$, and 101 .

Since $s=a+b+c+d$ for distinct digits $a, b, c, d$ chosen from the digits 1 to 9 , then the largest possible value of $s$ is $9+8+7+6=30$ and the smallest possible value is $1+2+3+4=10$. If $s=29$ (which occurs when $a, b, c, d$ are equal to $9,8,7,5$ in some order), then $N=2 \times 3 \times 11 \times 101 \times 29$ and the sum of the prime factors of $N$ is $2+3+11+101+29=146$ (since 29 is a prime number).

If $s$ is any other integer between 10 and 30 inclusive, the sum of its prime factors is less than 29. (See if you can convince yourself that all other possible values of $s$ have prime factors whose sum is less than 29. Alternately, you could list the prime factors of each of the integers from 10 to 30 to see that 29 is indeed the largest sum.)

Therefore, the largest sum of the distinct prime factors of $N$ is 146 .