// output of ./demo/seq/A187081-demo.cc: // Description: //% OEIS sequence A187081: sand piles by height. //% Same as: compositions of n where the first and the last parts are 1 and //% the absolute difference between consecutive parts is <=1. //% Also A186084: sand piles by base length. //% Also A186085: sand piles with n grains. //% Also A187080: fountains of coins by height. //% Also A047998: fountains of coins by base length. //% Also A005169: fountains of n coins. arg 1: 10 == n [Compositions of n (n>=1)] default=10 arg 2: 1 == sq [Whether to generate sandpiles (else fountains of coins)] default=1 arg 3: 1 == hq [Whether to gather stats about height (else about base length)] default=1 3 1: [ 1 2 3 2 1 1 ] 2 2: [ 1 2 2 2 2 1 ] 3 3: [ 1 1 2 3 2 1 ] 2 4: [ 1 2 2 2 1 1 1 ] 2 5: [ 1 2 2 1 2 1 1 ] 2 6: [ 1 2 1 2 2 1 1 ] 2 7: [ 1 1 2 2 2 1 1 ] 2 8: [ 1 2 2 1 1 2 1 ] 2 9: [ 1 2 1 2 1 2 1 ] 2 10: [ 1 1 2 2 1 2 1 ] 2 11: [ 1 2 1 1 2 2 1 ] 2 12: [ 1 1 2 1 2 2 1 ] 2 13: [ 1 1 1 2 2 2 1 ] 2 14: [ 1 2 2 1 1 1 1 1 ] 2 15: [ 1 2 1 2 1 1 1 1 ] 2 16: [ 1 1 2 2 1 1 1 1 ] 2 17: [ 1 2 1 1 2 1 1 1 ] 2 18: [ 1 1 2 1 2 1 1 1 ] 2 19: [ 1 1 1 2 2 1 1 1 ] 2 20: [ 1 2 1 1 1 2 1 1 ] 2 21: [ 1 1 2 1 1 2 1 1 ] 2 22: [ 1 1 1 2 1 2 1 1 ] 2 23: [ 1 1 1 1 2 2 1 1 ] 2 24: [ 1 2 1 1 1 1 2 1 ] 2 25: [ 1 1 2 1 1 1 2 1 ] 2 26: [ 1 1 1 2 1 1 2 1 ] 2 27: [ 1 1 1 1 2 1 2 1 ] 2 28: [ 1 1 1 1 1 2 2 1 ] 2 29: [ 1 2 1 1 1 1 1 1 1 ] 2 30: [ 1 1 2 1 1 1 1 1 1 ] 2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