Hello druvid fae

This is certainly a complex question, isn't it? So far, I think I've been able to come up with solutions for , and a suggestion for a general solution. I haven't any more time at present to complete the problem, but maybe you can do so.

Consider the case . Clearly there is no solution unless , since , and one solutions otherwise.

Now consider .

Since and , if , there is no solution; and there is no solution if , since in that case .

But if and , there will be at least one solution. In fact, provided and , there will be possible solutions from to .

Moreover, for each integer by which either or is less than , the number of solutions is reduced from by .

Thus, the number of solutions for is:

, where is the greater of the two integers and .

Now consider .

If and for all , then the number of solutions is at a maximum, since the may then have any values in the required range, . This maximum is , which we may prove as follows:

Suppose has the value . Then , and there are then possible pairs of values of and . Now since , takes values from to . Thus the total number of solutions is:

which is an AP with sum

(Incidentally, this is clearly , the number of ways of selecting items from , but at present I can't see why this should be so! Perhaps you can?)

So, taking the same line as when , I think the solution to is:

which we may write using sigma notation as:

For the general case, , for the maximum number of solutions and ; and, again, for every integer value below that a falls, the number of solutions will be reduced by (I think!). How do you get the maximum number of solutions? Is it ? I don't know. Perhaps you can take it a bit further, but I must sign off for the present.

Grandad

PS I've now worked out the maximum number of solutions for , and indeed it is , suggesting even more strongly that my guess for the general case is correct. But I still can't see why this should be so.

The other thing to note is that in working out the solution for , I used the solution for as follows:

If , then , and the number of ways in which this can occur is the same as the problem for , with being replaced by . Could a recursive method like this be applied to the general case, or is there a more direct way?