A relatively simple mathematical problem
/not for me though/
Given is a sorted list of integers:
a = {a1,a2,a3,...an}
I need to find a subset
b={b1,b2,b3...bm}
such that
b2-b1=x
b3-b2=x
b4-b3=x
...
Where x is an integer and x>0.
Among all possible subsets b, I’m interested in the ones with the maximum length, ie m should be as big as possible
How does one go about finding the x and the subset b ?
Thanks in advance
PS> Here’s a sample list to work with:
a={459, 468, 486, 495, 549, 567, 576, 594, 639, 648, 657, 675, 693, \
729, 738, 783, 792, 819, 837, 846, 864, 873, 891, 918, 927, 936, 945, \
954, 963, 972, 981};