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.

A123638 Consider the 2^n compositions of n and count only those ending in an odd part with row sum A001045.

This page as a plain text file.
%I A123638 #9 Jan 08 2018 01:58:30
%S A123638 1,1,3,8,25,83,299,1158,4813,21373,100955,504916,2662761,14754311,
%T A123638 85643459,519493938,3285790317,21628225041,147887079907,1048634836288,
%U A123638 7698589399833,58432476430139,457901993065915,3700291495531166
%N A123638 Consider the 2^n compositions of n and count only those ending in an odd part with row sum A001045.
%C A123638 Compositions ending in an even part yield sequence 0 1 2 6 18 ... A123639. and a(n)+A123639(n) = A047970(n). Ending parity of compositions can be detected using mod(A065120,2)
%e A123638 4
%e A123638 31 32 33
%e A123638 211 221 222
%e A123638 1111
%e A123638 Consider the above multisets: permute and note the parity of the ending part of each of the 14 compositions.
%e A123638 4
%e A123638 31 13 32 23 33
%e A123638 211 121 112 221 212 122 222
%e A123638 1111
%e A123638 4 is even
%e A123638 31 13 23 and 33 are odd
%e A123638 32 is even
%e A123638 etc
%e A123638 there are 0 + 4 + 3 + 1 = 8 odd compositions therefore a(4)=8.
%p A123638 g:= proc(b,t,l,m) option remember; if t=0 then b*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);
%t A123638 g[b_, t_, l_, m_] := g[b, t, l, m] = If[t == 0 , b*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 A123638 Cf. A001045 A047970 A065120 A123639 A123640 A123641.
%K A123638 nonn
%O A123638 1,3
%A A123638 _Alford Arnold_, Oct 04 2006
%E A123638 Offset corrected, Maple program and more terms added by _Alois P. Heinz_, Nov 06 2009