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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309938 Triangle read by rows: T(n,k) is the number of compositions of n with k parts and differences all equal to 1 or -1. 4
1, 1, 0, 1, 2, 0, 1, 0, 1, 0, 1, 2, 1, 0, 0, 1, 0, 2, 2, 0, 0, 1, 2, 1, 0, 1, 0, 0, 1, 0, 1, 4, 1, 0, 0, 0, 1, 2, 2, 0, 3, 2, 0, 0, 0, 1, 0, 1, 4, 2, 0, 1, 0, 0, 0, 1, 2, 1, 0, 3, 6, 1, 0, 0, 0, 0, 1, 0, 2, 4, 3, 0, 4, 2, 0, 0, 0, 0, 1, 2, 1, 0, 3, 8, 3, 0, 1, 0, 0, 0, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

Parts will alternate between being odd and even. For even k, a composition cannot be the same as its reversal and therefore for even k, T(n,k) is even.

LINKS

Table of n, a(n) for n=1..91.

EXAMPLE

Triangle begins:

  1;

  1, 0;

  1, 2, 0;

  1, 0, 1, 0;

  1, 2, 1, 0, 0;

  1, 0, 2, 2, 0,  0;

  1, 2, 1, 0, 1,  0, 0;

  1, 0, 1, 4, 1,  0, 0, 0;

  1, 2, 2, 0, 3,  2, 0, 0, 0;

  1, 0, 1, 4, 2,  0, 1, 0, 0, 0;

  1, 2, 1, 0, 3,  6, 1, 0, 0, 0, 0;

  1, 0, 2, 4, 3,  0, 4, 2, 0, 0, 0, 0;

  1, 2, 1, 0, 3,  8, 3, 0, 1, 0, 0, 0, 0;

  1, 0, 1, 4, 3,  0, 6, 8, 1, 0, 0, 0, 0, 0;

  1, 2, 2, 0, 4, 10, 5, 0, 5, 2, 0, 0, 0, 0, 0;

  ...

For n = 6 there are a total of 5 compositions:

  k = 1: (6)

  k = 3: (123), (321)

  k = 4: (2121), (1212)

PROG

(PARI)

step(R, n)={matrix(n, n, i, j, if(i>j, if(j>1, R[i-j, j-1]) + if(j+1<=n, R[i-j, j+1])) )}

T(n)={my(v=vector(n), R=matid(n), m=0); while(R, m++; v[m]+=vecsum(R[n, ]); R=step(R, n)); v}

for(n=1, 15, print(T(n)))

CROSSREFS

Row sums are A173258.

Cf. A309931, A309937, A309939, A325557.

Sequence in context: A116927 A137276 A287234 * A140581 A137277 A039975

Adjacent sequences:  A309935 A309936 A309937 * A309939 A309940 A309941

KEYWORD

nonn,tabl

AUTHOR

Andrew Howroyd, Aug 23 2019

STATUS

approved

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 28 15:33 EDT 2020. Contains 334684 sequences. (Running on oeis4.)