login
Number of partitions of n in which the sequence of frequencies of the summands is decreasing.
13

%I #18 Jul 15 2015 09:56:45

%S 1,1,2,2,3,3,4,4,6,5,7,8,8,9,13,10,13,15,16,18,21,17,24,28,26,26,36,

%T 32,38,42,40,46,52,48,63,63,59,63,85,77,81,92,89,102,116,98,122,134,

%U 130,140,157,145,165,182,190,191,207,195,235,259,232,252,293,279

%N Number of partitions of n in which the sequence of frequencies of the summands is decreasing.

%H Alois P. Heinz, <a href="/A100881/b100881.txt">Table of n, a(n) for n = 0..1000</a>

%e a(7) = 4 because in each of the four partitions [7], [3,3,1], [2,2,2,1], [1,1,1,1,1,1,1] the frequency with which a summand is used decreases as the summand decreases.

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

%p if n<0 then 0

%p elif n=0 then 1

%p elif i=0 then 0

%p else b(n, i-1, t)

%p +add(b(n-i*j, i-1, j), j=1..min(t-1, floor(n/i)))

%p fi

%p end:

%p a:= n-> b(n, n, n+1):

%p seq(a(n), n=0..60); # _Alois P. Heinz_, Feb 21 2011

%t b[n_, i_, t_] := b[n, i, t] = Which[n<0, 0, n==0, 1, i==0, 0, True, b[n, i-1, t] + Sum[b[n-i*j, i-1, j], {j, 1, Min[t-1, Floor[n/i]]}]]; a[n_] := b[n, n, n+1]; Table[a[n], {n, 0, 60}] (* _Jean-François Alcover_, Jul 15 2015, after _Alois P. Heinz_ *)

%o (Haskell)

%o a100881 = p 0 0 1 where

%o p m m' k x | x == 0 = if m > m' || m == 0 then 1 else 0

%o | x < k = 0

%o | m == 0 = p 1 m' k (x - k) + p 0 m' (k + 1) x

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

%o if m > m' then p 0 m (k + 1) x else 0

%o -- _Reinhard Zumkeller_, Dec 27 2012

%Y Cf. A100882, A100883, A100884.

%Y Cf. A100471, A098859.

%K nonn

%O 0,3

%A _David S. Newman_, Nov 21 2004

%E More terms from _Alois P. Heinz_, Feb 21 2011