OFFSET
0,3
COMMENTS
These are compositions of n whose second-differences are nonzero. - Gus Wiseman, Jun 03 2019
LINKS
Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 0..400
Wikipedia, Arithmetic progression
FORMULA
a(n) ~ c * d^n, where d = 1.866800016014240677813344121155900699..., c = 0.540817940878009616510727217687704495... - Vaclav Kotesovec, May 01 2014
EXAMPLE
The a(5) = 13 such compositions are:
01: [ 1 1 2 1 ]
02: [ 1 1 3 ]
03: [ 1 2 1 1 ]
04: [ 1 2 2 ]
05: [ 1 3 1 ]
06: [ 1 4 ]
07: [ 2 1 2 ]
08: [ 2 2 1 ]
09: [ 2 3 ]
10: [ 3 1 1 ]
11: [ 3 2 ]
12: [ 4 1 ]
13: [ 5 ]
MAPLE
# b(n, r, d): number of compositions of n where the leftmost part j
# does not have distance d to the recent part r
b:= proc(n, r, d) option remember; `if`(n=0, 1,
add(`if`(j=r+d, 0, b(n-j, j, j-r)), j=1..n))
end:
a:= n-> b(n, infinity, 0):
seq(a(n), n=0..45);
MATHEMATICA
b[n_, r_, d_] := b[n, r, d] = If[n == 0, 1, Sum[If[j == r + d, 0, b[n - j, j, j - r]], {j, 1, n}]]; a[n_] := b[n, Infinity, 0]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Nov 06 2014, after Maple *)
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !MemberQ[Differences[#, 2], 0]&]], {n, 0, 10}] (* Gus Wiseman, Jun 03 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt and Alois P. Heinz, Feb 26 2014
STATUS
approved