12345 Puzzle! Try to solve! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

12345 Puzzle! Try to solve!

Idea inspired from Agus Mei's quizzes! What is the result if all 5 digit numbers containing each of the digits 1,2,3,4,5 exactly once are added? Logic/Program solution should be given.

12th Apr 2017, 11:47 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
11 Answers
+ 25
@Krishna Teja Yeluripati 5! = 120 numbers possible, if we'll sum numbers with mirrored digits (12345 and 54321, 51324 and 15342...) we get 66666 for each pair of numbers; 66666 * 60 = 3999960
12th Apr 2017, 12:13 PM
Illusive Man
Illusive Man - avatar
+ 21
3999960
12th Apr 2017, 11:55 AM
Illusive Man
Illusive Man - avatar
+ 10
5!=120 12345 +54321 120/2=60 ------------ 66666 66666 x60 ------------- 3,999,960
12th Apr 2017, 1:06 PM
Theprogrammers
Theprogrammers - avatar
+ 9
120/5=24 24*120=2880? Just a guess that's wrong.
12th Apr 2017, 12:59 PM
Theprogrammers
Theprogrammers - avatar
+ 7
Oh. :| I dont think my logic works with floating points
12th Apr 2017, 12:11 PM
Pixie
Pixie - avatar
+ 7
@Illusive Man : Logical Solution. @Klaus-Dieter Warzecha - Program Solution. Well Done!
12th Apr 2017, 1:27 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
12th Apr 2017, 12:20 PM
Pixie
Pixie - avatar
+ 5
@Illusive man : Can you give the logic/program?
12th Apr 2017, 12:05 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 5
@Sweet Emotion : You are getting compilation error because maximum value of int is 32767.
12th Apr 2017, 12:09 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 3
If you prefer brute force and recognize that this is about permutations: https://code.sololearn.com/c30Msv90uSbA
12th Apr 2017, 1:00 PM
Klaus-Dieter Warzecha
Klaus-Dieter Warzecha - avatar
+ 1
This is a great idea, give me some time, I think I can do it :)
12th Apr 2017, 12:14 PM
Dextozz
Dextozz - avatar