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.

A097895 Number of compositions of n with at least 1 odd and 1 even part.

This page as a plain text file.
%I A097895 #29 May 29 2021 10:24:17
%S A097895 0,0,2,3,11,20,51,99,222,441,935,1872,3863,7751,15774,31653,63939,
%T A097895 128232,257963,517011,1037630,2078417,4165647,8340192,16702191,
%U A097895 33428943,66912446,133891725,267921227,536022488,1072395555,2145272571,4291442718,8584166169
%N A097895 Number of compositions of n with at least 1 odd and 1 even part.
%H A097895 Alois P. Heinz, <a href="/A097895/b097895.txt">Table of n, a(n) for n = 1..1000</a>
%H A097895 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,1,-8,2,4).
%F A097895 G.f.: x^3*(3*x-2)/((2*x-1)*(2*x^2-1)*(x^2+x-1)). - _Vladeta Jovovic_, Sep 03 2004
%F A097895 a(n) = 3*a(n-1) + a(n-2) - 8*a(n-3) + 2*a(n-4) + 4*a(n-5) for n > 5. - _Jinyuan Wang_, Mar 10 2020
%F A097895 From _Gregory L. Simay_, May 27 2021: (Start)
%F A097895 a(2*n) = 2^(2*n - 1) - 2^(n-1) - A000045(2*n).
%F A097895 a(2*n+1) = 2^(2*n) - A000045(2*n + 1). (End)
%e A097895 n=4: 2+1+1, 1+2+1, 1+1+2. Total=3.
%p A097895 G:=x^3*(3*x-2)/((2*x-1)*(2*x^2-1)*(x^2+x-1)): Gser:=series(G,x=0,37): seq(coeff(Gser,x^n),n=1..35); # _Emeric Deutsch_, Feb 15 2005
%p A097895 # second Maple program
%p A097895 b:= proc(n, o, e) option remember; `if`(n=0, `if`(o and e, 1, 0),
%p A097895       add(`if`(irem(i, 2)=1, b(n-i, true, e),
%p A097895                              b(n-i, o, true)), i=1..n))
%p A097895     end:
%p A097895 a:= n-> b(n, false$2):
%p A097895 seq(a(n), n=1..50);  # _Alois P. Heinz_, Jun 11 2013
%t A097895 e=(1-x^2)/(1-2x^2); o=(1-x^2)/(1-x-x^2); nn=30; Drop[CoefficientList[Series[(1-x)/(1-2x)-(o+e), {x,0,nn}], x], 1]  (* _Geoffrey Critzer_, Jan 18 2012 *)
%Y A097895 Cf. A000041 (partitions), A006477 (partitions of n with at least 1 odd and 1 even part), A000009 (partitions into odd parts), A035363 (partitions into even parts); A000079 (compositions). Compositions into odd parts give Fibonacci numbers (A000045), into even parts gives 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, ... (essentially A000079).
%Y A097895 Cf. A000045, A000041, A000009, A035363, A006477.
%Y A097895 Cf. A007179.
%K A097895 nonn
%O A097895 1,3
%A A097895 Dubois Marcel (dubois.ml(AT)club-internet.fr), Sep 03 2004
%E A097895 More terms from _Emeric Deutsch_, Feb 15 2005