Based on Reb Cabin's answer to the question:
linq get sets with adjacent[
^], i'd suggest to use Linq to achieve that:
var nums = new [] {1, 2, 3, 6, 7, 8, 14, 15};
var @group = 0;
nums.Zip(nums.Skip(1).Concat(new [] {nums.Last()}),
(n1, n2) => Tuple.Create(n1, (n2 - n1) == 1 ? @group : @group++))
.GroupBy (t => t.Item2)
.Select (g => new {Group = string.Join(",", g.Select(x => x.Item1)), Count = g.Count()})
.Dump();
Result:
Group Count
1,2,3 3
6,7,8 3
14,15 2