acc_successions function

Returns a vector with the number of consecutive nodes in each level