Post Reply 
challenge for programmable calculators
12-22-2013, 05:53 PM (This post was last modified: 12-22-2013 06:01 PM by Thomas Klemm.)
Post: #22
RE: challenge for programmable calculators
(12-22-2013 04:40 PM)Katie Wasserman Wrote:  
Quote:symmetry of the expression

Can you explain why you can break out of the loops early? While you'll get the right answer what's the mathematical reasoning behind it? If \( abc(a + b + c) = 100a + 10b + c \) were symmetric wouldn't you be able to swap positions of the variables without changing the results?

I was using the symmetry of \(abc(a + b + c)\) to bail out early for values ≥ 1000. We can do that since a ≤ b ≤ c. After noticing that (1 7 9) is too high it's still necessary to check (1 8 8) but we can skip the next value (1 9 9) since that is surely higher. For the same reason we don't need to check values after we noticed that (5 5 5) is too high.

I'm giving you here a list of all the checks that are performed (numbers in red are ≥ 1000):
a b c : \(abc(a + b + c)\)
1 1 1 : 3
1 1 2 : 8
1 1 3 : 15
1 1 4 : 24
1 1 5 : 35
1 1 6 : 48
1 1 7 : 63
1 1 8 : 80
1 1 9 : 99
1 2 2 : 20
1 2 3 : 36
1 2 4 : 56
1 2 5 : 80
1 2 6 : 108
1 2 7 : 140
1 2 8 : 176
1 2 9 : 216
1 3 3 : 63
1 3 4 : 96
1 3 5 : 135
1 3 6 : 180
1 3 7 : 231
1 3 8 : 288
1 3 9 : 351
1 4 4 : 144
1 4 5 : 200
1 4 6 : 264
1 4 7 : 336
1 4 8 : 416
1 4 9 : 504
1 5 5 : 275
1 5 6 : 360
1 5 7 : 455
1 5 8 : 560
1 5 9 : 675
1 6 6 : 468
1 6 7 : 588
1 6 8 : 720
1 6 9 : 864
1 7 7 : 735
1 7 8 : 896
1 7 9 : 1071
1 8 8 : 1088
2 2 2 : 48
2 2 3 : 84
2 2 4 : 128
2 2 5 : 180
2 2 6 : 240
2 2 7 : 308
2 2 8 : 384
2 2 9 : 468
2 3 3 : 144
2 3 4 : 216
2 3 5 : 300
2 3 6 : 396
2 3 7 : 504
2 3 8 : 624
2 3 9 : 756
2 4 4 : 320
2 4 5 : 440
2 4 6 : 576
2 4 7 : 728
2 4 8 : 896
2 4 9 : 1080
2 5 5 : 600
2 5 6 : 780
2 5 7 : 980
2 5 8 : 1200
2 6 6 : 1008
3 3 3 : 243
3 3 4 : 360
3 3 5 : 495
3 3 6 : 648
3 3 7 : 819
3 3 8 : 1008
3 4 4 : 528
3 4 5 : 720
3 4 6 : 936
3 4 7 : 1176
3 5 5 : 975
3 5 6 : 1260
3 6 6 : 1620
4 4 4 : 768
4 4 5 : 1040
4 5 5 : 1400
5 5 5 : 1875

But of course the digits of these values should be sorted as well when comparing them to \(100a + 10b + c\). I just noticed that with these two solutions (135 and 144) it's not necessary to do that as they are already in the correct order. So I was lazy and left that as an exercise.

Kind regards
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: challenge for programmable calculators - Thomas Klemm - 12-22-2013 05:53 PM
Proof using number theory - cruff - 12-24-2013, 05:43 PM
RE: challenge for programmable calculators - radwilliams - 12-24-2013, 05:57 PM



User(s) browsing this thread: 1 Guest(s)