Sum of all arrangement

There are 24 ways to construct a 4-digit number from 1, 2, 3, and 4. What is the sum of all such 4-digit numbers?

66660 66000 66666 10000

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Chew-Seong Cheong
Mar 15, 2019

There are 24 numbers with 1, 2, 3, and 4 as digits. For each of the four digits, say the units digit d 0 d_0 , 1, 2, 3, and 4 appear the number of times. Therefore, 1 appears 6 times, 2 appears 6 times, 3 appears 6 times and 4 appears 6 times. The sum of units digits is 6 × 4 ( 4 + 1 ) 2 = 60 6 \times \dfrac {4(4+1)}2 = 60 .

It is the same for the tens (d_1), hundreds d 2 d_2 , and thousands d 3 d_3 units. Therefore the sum of all 24 of these numbers is 60 ( 1 + 10 + 100 + 1000 ) = 60 ( 1111 ) = 66660 60 (1+10+100+1000) = 60(1111) = \boxed{66660} .

Kyle T
Mar 14, 2019

<?php
$arr = range(1,4);
do{
$newarr = array();
foreach($arr as $a){
for($i=1;$i<=4;$i++){
if(!preg_match('@'.$i.'@',$a)){
$newarr[] = $a.$i;
}
}
}
$arr = $newarr;
} while(strlen($arr[0])<4);
echo array_sum($arr); //66660
?>


0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...