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.

A123639 Consider the 2^n compositions of n and count only those ending in an even part.

This page as a plain text file.
%I A123639 #14 Nov 04 2013 10:02:07
%S A123639 0,1,2,6,18,61,224,890,3784,17113,81950,414230,2204110,12314109,
%T A123639 72049548,440379770,2805266692,18584809833,127812870474,910990458022,
%U A123639 6719535098378,51223251471453,403044829472760,3269538955148698,27314067026782976,234749040898160153
%N A123639 Consider the 2^n compositions of n and count only those ending in an even part.
%C A123639 Compositions ending in an even part yield sequence 0 1 2 6 18 ... (this sequence). and A123638(n)+a(n) = A047970(n). Ending parity of compositions can be detected using mod(A065120,2)
%H A123639 Alois P. Heinz, <a href="/A123639/b123639.txt">Table of n, a(n) for n = 1..225</a>
%e A123639 4
%e A123639 31 32 33
%e A123639 211 221 222
%e A123639 1111
%e A123639 Consider the above multisets- permute and note the parity of the ending part of each of the 14 compositions.
%e A123639 4
%e A123639 31 13 32 23 33
%e A123639 211 121 112 221 212 122 222
%e A123639 1111
%e A123639 4 is even
%e A123639 31 13 23 and 33 are odd
%e A123639 32 is even
%e A123639 etc
%e A123639 there are 1+1+4+0 even compositions therefore a(4)=6.
%p A123639 g:= proc(b,t,l,m) option remember; if t=0 then b*(1-l) else add (g(b, t-1, irem(k, 2), m), k=1..m-1) +g(1, t-1, irem(m, 2), m) fi end: a:= n-> add (g(0, k, 0, n+1-k), k=1..n): seq (a(n), n=1..30); # _Alois P. Heinz_, Nov 06 2009
%t A123639 g[b_, t_, l_, m_] := g[b, t, l, m] = If[ t == 0 , b*(1-l), Sum[g[b, t-1, Mod[k, 2], m], {k, 1, m-1}] + g[1, t-1, Mod[m, 2], m]]; a[n_] := Sum[g[0, k, 0, n+1-k], {k, 1, n}]; Table[a[n], {n, 1, 30}] (* _Jean-François Alcover_, Nov 04 2013, translated from Alois P. Heinz's Maple program *)
%Y A123639 Cf. A001045, A047970, A065120, A123638, A123640, A123641.
%K A123639 nonn
%O A123639 1,3
%A A123639 _Alford Arnold_, Oct 04 2006
%E A123639 More terms from _Alois P. Heinz_, Nov 06 2009