login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214256 Number of compositions of n where differences between neighboring parts are in {-2,-1,1,2}. 2

%I #15 Nov 16 2014 15:10:05

%S 1,1,1,3,4,5,11,14,18,36,49,66,118,169,238,401,586,846,1371,2042,2998,

%T 4731,7114,10566,16419,24809,37118,57139,86558,130151,199193,302109,

%U 455737,695084,1054761,1594484,2426813,3683310,5575665,8475607,12864385,19490762

%N Number of compositions of n where differences between neighboring parts are in {-2,-1,1,2}.

%H Alois P. Heinz, <a href="/A214256/b214256.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) ~ c * d^n, where d = 1.517398641547133636808941933115508174163721854365273284016518..., c = 0.733002948674062952076493110095119568735789170592785923762247... . - _Vaclav Kotesovec_, Sep 02 2014

%e a(4) = 4: [4], [3,1], [1,3], [1,2,1].

%e a(5) = 5: [5], [3,2], [2,3], [2,1,2], [1,3,1].

%e a(6) = 11: [6], [4,2], [3,2,1], [3,1,2], [2,4], [2,3,1], [2,1,3], [2,1,2,1], [1,3,2], [1,2,3], [1,2,1,2].

%p b:= proc(n, i) option remember; `if`(n<1 or i<1, 0,

%p `if`(n=i, 1, add(b(n-i, i+j), j=[-2, -1, 1, 2])))

%p end:

%p a:= n-> `if`(n=0, 1, add(b(n, j), j=1..n)):

%p seq(a(n), n=0..70);

%t b[n_, i_] := b[n, i] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n-i, i+j], {j, {-2, -1, 1, 2}}]]]; a[n_] := If[n == 0, 1, Sum[b[n, j], {j, 1, n}]]; Table[a[n], {n, 0, 70}] (* _Jean-François Alcover_, Nov 06 2014, after _Alois P. Heinz_ *)

%Y Column k=2 of A214249.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Jul 08 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)