Tag Info

New answers tagged

0

This will kludge it up: c = Cases[{#, Chop@FindFit[#, a x + b, {a, b}, x]} & /@ Subsets[data, {4, Length@data}], {_, {a -> aa_, b -> bb_}} /; FractionalPart[Round[aa, .0001]] == 0 && FractionalPart[Round[bb, .0001]] == 0]; Last@SortBy[c, Length] (* {{2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24}, {a -> 2., b -> 0}} *) ...


0

Finding Subsequences First off, here's the code I used to verify my solutions: Sort@DeleteDuplicates[ Select[Select[Reverse@Subsets[data, {3, ∞}], Equal @@ Differences[#] &], Unequal @@ # &], SubsetQ[##] && Equal @@ Sign@*First@*Differences /@ {##} &] First, we get all Subsets of data that are no shorter than three elements ...



Top 50 recent answers are included