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.

A240750 Table where row n contains all compositions of n into an even number of parts.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 2, 2, 1, 3, 1, 1, 1, 1, 4, 1, 3, 2, 2, 3, 2, 1, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 5, 1, 4, 2, 3, 3, 3, 1, 1, 1, 2, 4, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 5, 1, 3, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1
Offset: 2

Views

Author

Keywords

Comments

Can also be regarded as a table where row n is the n-th composition into an even number of parts, sorted by sum of composition and then reverse lexicographically.

Examples

			The table starts:
{}
(none)
11
21,12
31,22,13,1111
41,32,23,2111,14,1211,1121,1112
51,42,33,3111,24,2211,2121,2112,15,1311,1221,1212,1131,1122,1113,111111
		

Crossrefs

Cf. A066099, A240837, A001969, A034008 (compositions in rows), A087447 (parts in rows for n>2).

Programs

  • PARI
    evil(n) = local(r=0,m=n);while(m>0,if(m%2==1,r=1-r);m\=2);n*2+r
    A066099row(n) = {local(v=vector(n), j=0, k=0);
       while(n>0, k++; if(n%2==1, v[j++]=k; k=0); n\=2);
       vector(j, i, v[j-i+1])}
    arow(n)=A066099row(evil(n))