I have nested lists which consist of a series of 1s followed by a series of 0s.
p = Table[PerfectNumber[n], {n, 5}];
i = IntegerDigits[p, 2]
which results in:
{{1, 1, 0}, {1, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
Now I want a list which gives me the maximum number of consecutive 1s in each of the lists (yes, I realize that in the given example they're all consecutive, but I'm interested in a more generic solution):
{2, 3, 5, 7, 13}
How can I achieve this?