What will be the sum of all five digit numbers which can be formed with the digits 0, 1, 2,3,4 without repetition

A. 2599980

B. 235500

C. 923580

D. 765432

# PandC aptitude tcs

**imsaksham9**#2

If u observe each digit will be present at each position in 4! time.

i.e.,

No of times 0 is in first(ten thousand) place is (5-1)! = 4!= 4*3*2*1 = 24
In the same way ,
Number of times 1 is in first place is (5-1)! = 4!= 4*3

*2*1 = 24

Number of times 2 is in first place is (5-1)! = 4!= 4

*3*2

*1 = 24*

Number of times 3 is in first place is (5-1)! = 4!= 43

Number of times 3 is in first place is (5-1)! = 4!= 4

*2*1 = 24

Number of times 4 is in first place is (5-1)! = 4!= 4

*3*2

*1 = 24*

Number of times 0 is in second( thousand) place is (5-1)! = 4!= 43

Number of times 0 is in second( thousand) place is (5-1)! = 4!= 4

*2*1 = 24

.

.

.

.

Number of times 4 in fifth(One’s) place is (5-1)! = 4!= 4

*3*2*1 = 24

So the sum of all numbers will be

= (5-1)! * (10000+1000+100+10+1)*(0+1+2+3+4)
= 4! * (11111) 10
= 24 11111*10

= 2666640

Logic can be (n-1)!*(111…1 ntimes)*(sum of digits)

As numbers formed by digits 1,2,3,4 and 0 as first digits are not 5 digit numbers, so subtracting 4 digit numbers formed by 1,2,3,4

i.e., 2666640 - 3!*(1111)*(1+2+3+4)

= 2666640 - 6666*10

= 2666640 -66660

= 2599980