cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A238422 Number of compositions of n where no consecutive parts differ by 1.

This page as a plain text file.
%I A238422 #17 Nov 06 2014 09:53:55
%S A238422 1,1,2,2,5,7,15,23,43,70,128,214,383,651,1149,1971,3457,5961,10412,
%T A238422 18011,31384,54384,94639,164163,285454,495452,861129,1495126,2597970,
%U A238422 4511573,7838280,13613289,23649355,41076088,71354998,123939602,215294730,373962643,649597906,1128352145
%N A238422 Number of compositions of n where no consecutive parts differ by 1.
%H A238422 Joerg Arndt and Alois P. Heinz, <a href="/A238422/b238422.txt">Table of n, a(n) for n = 0..1000</a>
%F A238422 a(n) ~ c * d^n, where c = 0.501153706040308227351395770679776260606990346633815... and d = 1.737029107886986816124470304294547513896522086125645631179... - _Vaclav Kotesovec_, Feb 26 2014
%e A238422 The a(6) = 15 such compositions are:
%e A238422 01:  [ 1 1 1 1 1 1 ]
%e A238422 02:  [ 1 1 1 3 ]
%e A238422 03:  [ 1 1 3 1 ]
%e A238422 04:  [ 1 1 4 ]
%e A238422 05:  [ 1 3 1 1 ]
%e A238422 06:  [ 1 4 1 ]
%e A238422 07:  [ 1 5 ]
%e A238422 08:  [ 2 2 2 ]
%e A238422 09:  [ 2 4 ]
%e A238422 10:  [ 3 1 1 1 ]
%e A238422 11:  [ 3 3 ]
%e A238422 12:  [ 4 1 1 ]
%e A238422 13:  [ 4 2 ]
%e A238422 14:  [ 5 1 ]
%e A238422 15:  [ 6 ]
%p A238422 # b(n, i): number of compositions of n where the leftmost part j
%p A238422 #          and i do not have distance 1
%p A238422 b:= proc(n, i) option remember; `if`(n=0, 1,
%p A238422       add(`if`(abs(i-j)=1, 0, b(n-j, j)), j=1..n))
%p A238422     end:
%p A238422 a:= n-> b(n, -1):
%p A238422 seq(a(n), n=0..50);
%t A238422 b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[If[Abs[i - j] == 1, 0, b[n - j, j]], {j, 1, n}]]; a[n_] := b[n, -1]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Nov 06 2014, after Maple *)
%Y A238422 Cf. A116931 (partitions where no consecutive parts differ by 1).
%K A238422 nonn
%O A238422 0,3
%A A238422 _Joerg Arndt_ and _Alois P. Heinz_, Feb 26 2014