Determine the total number of quadruplets (A, B, C, D) of positive integers such that:
- A divides B, and:
- B divides C, and:
- C divides D, and:
- A+B+C+D=4200
(In reply to
software solution by Charlie)
Just for the heck of it, if a, b, c and d were required to be unique (no repeated integer):
95 such cases among the original set:
1 13 26 4160
1 13 91 4095
1 13 182 4004
1 13 299 3887
1 13 598 3588
1 17 34 4148
1 17 51 4131
1 17 102 4080
1 17 697 3485
1 17 1394 2788
1 19 38 4142
1 19 76 4104
1 19 95 4085
1 19 190 3990
1 19 209 3971
1 19 380 3800
1 19 418 3762
1 19 836 3344
1 19 1045 3135
1 221 442 3536
1 221 663 3315
1 221 1326 2652
1 247 494 3458
1 247 988 2964
1 323 646 3230
1 323 969 2907
1 323 1292 2584
6 18 36 4140
6 18 72 4104
6 18 144 4032
6 18 522 3654
6 18 1044 3132
8 16 48 4128
8 16 144 4032
8 16 464 3712
8 16 1392 2784
8 32 64 4096
8 32 160 4000
8 32 320 3840
8 32 416 3744
8 32 832 3328
14 182 364 3640
14 322 644 3220
14 322 966 2898
14 322 1288 2576
15 45 90 4050
15 45 180 3960
15 45 1035 3105
15 135 270 3780
15 135 405 3645
15 135 675 3375
15 135 810 3240
15 135 1350 2700
15 465 930 2790
20 220 440 3520
20 220 660 3300
20 220 1320 2640
20 380 760 3040
24 48 96 4032
24 72 216 3888
24 72 1368 2736
24 144 288 3744
24 144 576 3456
24 144 1008 3024
35 245 490 3430
35 245 980 2940
35 595 1190 2380
40 80 240 3840
40 80 1360 2720
40 160 800 3200
40 320 640 3200
40 320 960 2880
40 320 1280 2560
42 126 252 3780
42 126 504 3528
42 126 1008 3024
42 378 756 3024
42 462 924 2772
56 112 224 3808
56 112 336 3696
56 112 448 3584
56 112 672 3360
56 112 1008 3024
56 112 1344 2688
60 180 360 3600
75 375 750 3000
84 588 1176 2352
105 315 630 3150
105 315 945 2835
105 315 1260 2520
120 240 480 3360
120 240 960 2880
150 450 900 2700
200 400 1200 2400
280 560 1120 2240
95 done
tot = 4200
For a = 1 To tot / 4
For b = a + 1 To (tot - a) / 3
If b Mod a = 0 Then
For c = b + 1 To (tot - a - b) / 2
If c Mod b = 0 Then
d = tot - a - b - c
If d Mod c = 0 And d > c Then
Text1.Text = Text1.Text & Str(a) & Str(b) & Str(c) & Str(d) & crlf
ct = ct + 1
DoEvents
End If
End If
Next c
End If
Next b
Next a
|
Posted by Charlie
on 2014-08-19 10:03:12 |