Timed 10: Why Four Numbers
Timed 10 asks for the greatest common divisor of four integers. However, the GCD between any two of the given numbers is the GCD between all four. I can only assume this was unintentional because giving four numbers instead of two is merely a waste.
In order to force users to use more than their built in GCD library function (or the whole 5 lines, max, it takes to implement one) I would suggest having the GCD between the four numbers be different than the GCD amongst any two of the numbers. Thus, having the users think slightly beyond using predefined functions.
Vty wrote: Timed 10 asks for the greatest common divisor of four integers. However, the GCD between any two of the given numbers is the GCD between all four. gcd(16, 24) = 8 gcd(16, 24, 36) = 4 gcd(16, 24, 36, 42) = 2
EDIT: Oh, I see you were referring to just the particular numbers given in the challenge, not in general. Well here are the numbers that were just generated by the challenge when I loaded it: 1660 6391 3984 8134 gcd(1660, 6391) = 83 gcd(1660, 8134) = 166 gcd(1660, 3984) = 332 gcd(8134, 6391) = 581
Hmm, yes I see. Well I'm glad that's the case. I just tested it again and now after the third set I've seen, it was different for one set of numbers. It works as intended then - even though it could be a bit more random.
EDIT: I see you can simply pass more parameters to your built in GCD functions anyway. Shucks.