login
Number of partitions of 2n into factorial parts (0! not allowed, i.e., only one kind of 1 can be a part). Also number of partitions of 2n+1 into factorial parts.
2

%I #29 Nov 03 2023 16:05:08

%S 1,2,3,5,7,9,12,15,18,22,26,30,36,42,48,56,64,72,82,92,102,114,126,

%T 138,153,168,183,201,219,237,258,279,300,324,348,372,400,428,456,488,

%U 520,552,588,624,660,700,740,780,825,870,915,965,1015,1065,1120,1175,1230

%N Number of partitions of 2n into factorial parts (0! not allowed, i.e., only one kind of 1 can be a part). Also number of partitions of 2n+1 into factorial parts.

%C a(n) = A064986(2n) = A064986(2n+1). The first 48 terms of this sequence agree with those of A090632.

%C a(n) = A064986(2*n) = A064986(2*n+1). - _Reinhard Zumkeller_, Dec 04 2011

%H Alois P. Heinz, <a href="/A117930/b117930.txt">Table of n, a(n) for n = 0..1000</a> (first 250 terms from Reinhard Zumkeller)

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>

%F G.f.: 1/((1-x)*Product_{j>=2} (1 - x^(j!/2))).

%e a(3) = 5 because the partitions of 6 into factorials are [6], [2,2,2], [2,2,1,1], [2,1,1,1,1] and [1,1,1,1,1,1].

%p g:=1/(1-x)/product(1-x^(j!/2),j=2..7): gser:=series(g,x=0,70): seq(coeff(gser,x,n),n=0..65);

%p # second Maple program

%p b:= proc(n, i) option remember;

%p `if`(n=0 or i=1, 1, b(n, i-1)+

%p `if`(i!>n, 0, b(n-i!, i)))

%p end:

%p a:= proc(n) local i;

%p for i while(i!<2*n) do od;

%p b(2*n, i)

%p end:

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Jun 13 2012

%t f[n_] := Length@ IntegerPartitions[2 n, All, {1, 2, 6, 24, 120}]; Array[f, 57, 0] (* _Robert G. Wilson v_, Oct 02 2014 *)

%t b[n_, i_] := b[n, i] = If[n==0 || i==1, 1, b[n, i-1] + If[i!>n, 0, b[n-i!, i] ] ]; a[n_] := Module[{i}, For[i=1, i!<2*n, i++]; b[2*n, i]]; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Jun 29 2015, after _Alois P. Heinz_ *)

%o (Haskell)

%o a117930 n = p (tail a000142_list) $ 2*n where

%o p _ 0 = 1

%o p ks'@(k:ks) m | m < k = 0

%o | otherwise = p ks' (m - k) + p ks m

%o -- _Reinhard Zumkeller_, Dec 04 2011

%Y Cf. A064986, A090632.

%K nonn

%O 0,2

%A _Emeric Deutsch_, Apr 04 2006

%E An incorrect g.f. was deleted by _N. J. A. Sloane_, Sep 16 2009