login
Number of 2's in the partitions of n into exactly 5 parts.
3

%I #32 May 25 2026 20:42:02

%S 0,0,0,0,0,0,1,2,4,7,12,13,18,22,28,33,41,47,57,65,76,86,100,111,127,

%T 141,159,175,196,214,238,259,285,309,339,365,398,428,464,497,537,573,

%U 617,657,704,748,800,847,903,955,1015,1071,1136,1196,1266,1331,1405,1475,1555

%N Number of 2's in the partitions of n into exactly 5 parts.

%H Vincenzo Librandi, <a href="/A396011/b396011.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,0,0,-2,0,0,1,1,-1).

%F G.f.: q^5 * Sum_{j=1..5} q^j / Product_{k=1..5-j} (1 - q^k).

%F a(n) = a(n-1) + a(n-2) - 2*a(n-5) + a(n-8) + a(n-9) - a(n-10) for n > 20.

%F a(n) = A320592(n+2) - 1 for n > 10.

%t m=60; a=CoefficientList[Series[x^5 Sum[x^j/Product[1-x^k,{k,1,5-j}],{j,1,5}],{x,0,m}],x]; a (* _Vincenzo Librandi_, May 22 2026 *)

%o (PARI) my(N=60, q='q+O('q^N)); concat([0, 0, 0, 0, 0, 0], Vec(q^5*sum(j=1, 5, q^j/prod(k=1, 5-j, 1-q^k))))

%o (Magma) N := 60; R<q> := PowerSeriesRing(Integers(), N); a := [0,0,0,0,0,0] cat Coefficients( q^5 * &+[ q^j / (5-j eq 0 select 1 else &*[1-q^k : k in [1..5-j]]) : j in [1..5] ] ); a; // _Vincenzo Librandi_, May 22 2026

%Y Cf. A394873, A396012.

%Y Cf. A024786, A026811, A320592, A394827.

%K nonn,easy

%O 0,8

%A _Seiichi Manyama_, May 13 2026