Add-on for the 'number' problem.
No way, Mitch. If anyone extends the range to include negative integers, you get quite a big number of pairs the add up to the given sum S. It's inhuman. I wouldn't even try it on a computer...
So I must specify that the range is included in [1;255].
Some other hints? There is a unique pair in any range between [2;35] and [2;255], between [3;14] and [3;47] (at [3;48] comes another one, at [3;51] other, at [3;57] other, at [3;93] other, at [3;123] other, at [3;141] other and at [3;212] the last newcomer - so in [3;255] we have eight pairs of numbers...) and between [4;57] and [4;255].
Remark: even ranges that start with one (which must contain 52) have pairs of numbers which satisfy the given problem.
Related problems: if you're Mr. S and you know the numbers are in [3;50] and you're given '25' for the sum of the two numbers, which numbers were chosen? What if you're Mr. P, know the range [4;60] and the product '184'? Conclusion: it's harder if you're S, right?
Yes, Tom, my mistake about that sum 26. It's 52, of course.
If anyone is interested, neither Mitch nor Tom (aka Spyder) got a correct answer. |