login
Number of parts in all twice partitions of n.
6

%I #32 Mar 13 2026 20:11:38

%S 0,1,5,14,44,100,274,581,1417,2978,6660,13510,29479,58087,120478,

%T 236850,476913,916940,1812498,3437043,6657656,12512273,23780682,

%U 44194499,83117200,152837210,283431014,517571202,949844843,1719175176,3127751062,5618969956,10133425489

%N Number of parts in all twice partitions of n.

%H Alois P. Heinz, <a href="/A327594/b327594.txt">Table of n, a(n) for n = 0..3200</a>

%e a(2) = 5 = 1+2+2 counting the parts in 2, 11, 1|1.

%e a(3) = 14 = 1+2+3+2+3+3: 3, 21, 111, 2|1, 11|1, 1|1|1.

%p g:= proc(n) option remember; (p-> [p(n), add(p(n-j)*

%p numtheory[tau](j), j=1..n)])(combinat[numbpart])

%p end:

%p b:= proc(n, i) option remember; `if`(n=0, [1, 0],

%p `if`(i<2, 0, b(n, i-1)) +(h-> (f-> f +[0, f[1]*

%p h[2]/h[1]])(b(n-i, min(n-i, i))*h[1]))(g(i)))

%p end:

%p a:= n-> b(n$2)[2]:

%p seq(a(n), n=0..37);

%p # Alternative:

%p b:= proc(n, i, k) option remember; `if`(n=0, [1, 0],

%p `if`(k=0, [1, 1], `if`(i<2, 0, b(n, i-1, k))+

%p (h-> (f-> f +[0, f[1]*h[2]/h[1]])(h[1]*

%p b(n-i, min(n-i, i), k)))(b(i$2, k-1))))

%p end:

%p a:= n-> b(n$2, 2)[2]:

%p seq(a(n), n=0..37);

%t b[n_, i_, k_] := b[n, i, k] = If[n == 0, {1, 0}, If[k == 0, {1, 1}, If[i < 2, 0, b[n, i - 1, k]] + Function[h, Function[f, f + {0, f[[1]] h[[2]]/ h[[1]]}][h[[1]] b[n - i, Min[n - i, i], k]]][b[i, i, k - 1]]]];

%t a[n_] := b[n, n, 2][[2]];

%t a /@ Range[0, 37] (* _Jean-François Alcover_, Dec 05 2020, after _Alois P. Heinz_ *)

%Y Cf. A000041, A006128, A063834, A327590, A327605, A327607, A327608.

%Y Column k=2 of A327618.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Sep 18 2019