*****************************************************************************
*       www.FindStat.org - The Combinatorial Statistic Finder               *
*                                                                           *
*       Copyright (C) 2019 The FindStatCrew <info@findstat.org>             *
*                                                                           *
*    This information is distributed in the hope that it will be useful,    *
*    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                   *
*****************************************************************************

-----------------------------------------------------------------------------
Statistic identifier: St000091

-----------------------------------------------------------------------------
Collection: Integer compositions

-----------------------------------------------------------------------------
Description: The descent variation of a composition.

Defined in [1].

-----------------------------------------------------------------------------
References: [1]  Archibald, M., Knopfmacher, A., Mansour, T. Variation statistics on compositions [[MathSciNet:2977908]]

-----------------------------------------------------------------------------
Code:
def statistic(alp):
    return sum([abs(alp[i+1]-alp[i]) for i in range(len(alp) - 1) if alp[i+1] > alp[i]])

-----------------------------------------------------------------------------
Statistic values:

[1]             => 0
[1,1]           => 0
[2]             => 0
[1,1,1]         => 0
[1,2]           => 1
[2,1]           => 0
[3]             => 0
[1,1,1,1]       => 0
[1,1,2]         => 1
[1,2,1]         => 1
[1,3]           => 2
[2,1,1]         => 0
[2,2]           => 0
[3,1]           => 0
[4]             => 0
[1,1,1,1,1]     => 0
[1,1,1,2]       => 1
[1,1,2,1]       => 1
[1,1,3]         => 2
[1,2,1,1]       => 1
[1,2,2]         => 1
[1,3,1]         => 2
[1,4]           => 3
[2,1,1,1]       => 0
[2,1,2]         => 1
[2,2,1]         => 0
[2,3]           => 1
[3,1,1]         => 0
[3,2]           => 0
[4,1]           => 0
[5]             => 0
[1,1,1,1,1,1]   => 0
[1,1,1,1,2]     => 1
[1,1,1,2,1]     => 1
[1,1,1,3]       => 2
[1,1,2,1,1]     => 1
[1,1,2,2]       => 1
[1,1,3,1]       => 2
[1,1,4]         => 3
[1,2,1,1,1]     => 1
[1,2,1,2]       => 2
[1,2,2,1]       => 1
[1,2,3]         => 2
[1,3,1,1]       => 2
[1,3,2]         => 2
[1,4,1]         => 3
[1,5]           => 4
[2,1,1,1,1]     => 0
[2,1,1,2]       => 1
[2,1,2,1]       => 1
[2,1,3]         => 2
[2,2,1,1]       => 0
[2,2,2]         => 0
[2,3,1]         => 1
[2,4]           => 2
[3,1,1,1]       => 0
[3,1,2]         => 1
[3,2,1]         => 0
[3,3]           => 0
[4,1,1]         => 0
[4,2]           => 0
[5,1]           => 0
[6]             => 0
[1,1,1,1,1,1,1] => 0
[1,1,1,1,1,2]   => 1
[1,1,1,1,2,1]   => 1
[1,1,1,1,3]     => 2
[1,1,1,2,1,1]   => 1
[1,1,1,2,2]     => 1
[1,1,1,3,1]     => 2
[1,1,1,4]       => 3
[1,1,2,1,1,1]   => 1
[1,1,2,1,2]     => 2
[1,1,2,2,1]     => 1
[1,1,2,3]       => 2
[1,1,3,1,1]     => 2
[1,1,3,2]       => 2
[1,1,4,1]       => 3
[1,1,5]         => 4
[1,2,1,1,1,1]   => 1
[1,2,1,1,2]     => 2
[1,2,1,2,1]     => 2
[1,2,1,3]       => 3
[1,2,2,1,1]     => 1
[1,2,2,2]       => 1
[1,2,3,1]       => 2
[1,2,4]         => 3
[1,3,1,1,1]     => 2
[1,3,1,2]       => 3
[1,3,2,1]       => 2
[1,3,3]         => 2
[1,4,1,1]       => 3
[1,4,2]         => 3
[1,5,1]         => 4
[1,6]           => 5
[2,1,1,1,1,1]   => 0
[2,1,1,1,2]     => 1
[2,1,1,2,1]     => 1
[2,1,1,3]       => 2
[2,1,2,1,1]     => 1
[2,1,2,2]       => 1
[2,1,3,1]       => 2
[2,1,4]         => 3
[2,2,1,1,1]     => 0
[2,2,1,2]       => 1
[2,2,2,1]       => 0
[2,2,3]         => 1
[2,3,1,1]       => 1
[2,3,2]         => 1
[2,4,1]         => 2
[2,5]           => 3
[3,1,1,1,1]     => 0
[3,1,1,2]       => 1
[3,1,2,1]       => 1
[3,1,3]         => 2
[3,2,1,1]       => 0
[3,2,2]         => 0
[3,3,1]         => 0
[3,4]           => 1
[4,1,1,1]       => 0
[4,1,2]         => 1
[4,2,1]         => 0
[4,3]           => 0
[5,1,1]         => 0
[5,2]           => 0
[6,1]           => 0
[7]             => 0

-----------------------------------------------------------------------------
Created: Jun 13, 2013 at 15:53 by Chris Berg

-----------------------------------------------------------------------------
Last Updated: May 29, 2015 at 16:46 by Martin Rubey