The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A214270 Number of compositions of n where the difference between largest and smallest parts equals 1 and adjacent parts are unequal. 3

%I

%S 0,0,2,1,3,2,4,2,4,4,4,3,5,4,6,2,6,6,4,4,6,6,6,3,7,4,8,6,4,6,6,6,8,4,

%T 8,4,6,8,8,5,5,8,6,4,12,6,6,4,8,8,6,8,8,6,8,4,8,8,8,9,5,6,12,2,8,8,10,

%U 8,6,8,6,8,8,6,10,6,12,8,4,6,10,8,8,7,11

%N Number of compositions of n where the difference between largest and smallest parts equals 1 and adjacent parts are unequal.

%H Alois P. Heinz, <a href="/A214270/b214270.txt">Table of n, a(n) for n = 1..10000</a>

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

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

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

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

%e a(19) = 4: [9,10], [6,7,6], [10,9], [1,2,1,2,1,2,1,2,1,2,1,2,1].

%e a(25) = 7: [13,12], [12,13], [8,9,8], [4,3,4,3,4,3,4], [3,2,3,2,3,2,3,2,3,2], [2,3,2,3,2,3,2,3,2,3], [1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1].

%p a:= proc(n) local m, r, s, t;

%p r, s, t:= 0, 1, 2;

%p while s+t<=n do m:= irem(n, s+t);

%p r:= r+ `if`(m=0, 2, `if`(m in {s, t}, 1, 0));

%p s, t:= s+1, t+1

%p od; r

%p end:

%p seq(a(n), n=1..100);

%Y Column k=1 of A214269.

%K nonn

%O 1,3

%A _Alois P. Heinz_, Jul 09 2012

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

Last modified September 22 20:23 EDT 2020. Contains 337291 sequences. (Running on oeis4.)