login
Number of partitions of 2n in which every part is <n; also, the number of partitions of 2 into rational numbers a/b such that 0<a<b<=n and b divides n.
4

%I #22 Apr 18 2019 03:23:12

%S 0,1,4,10,23,47,90,164,288,488,807,1303,2063,3210,4920,7434,11098,

%T 16380,23928,34624,49668,70667,99795,139935,194930,269857,371413,

%U 508363,692195,937838,1264685,1697810,2269557,3021462,4006812,5293650,6968730,9142306,11954194

%N Number of partitions of 2n in which every part is <n; also, the number of partitions of 2 into rational numbers a/b such that 0<a<b<=n and b divides n.

%H Alois P. Heinz, <a href="/A209815/b209815.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A008284(3*n-1,n-1). - _Hans Loeblich_ Apr 18 2019

%e The 4 partitions of 6 with parts <3:

%e 2+2+2, 2+2+1+1, 2+1+1+1+1, 1+1+1+1+1+1.

%e Matching partitions of 2 into rationals as described:

%e 2/3 + 2/3 + 2/3

%e 2/3 + 2/3 + 1/3 + 1/3

%e 2/3 + 1/3 + 1/3 + 1/3 + 1/3

%e 1/3 + 1/3 + 1/3 + 1/3 + 1/3 + 1/3.

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

%p `if`(i<1, 0, b(n, i-1)+`if`(i>n, 0, b(n-i, i))))

%p end:

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

%p seq(a(n), n=1..50); # _Alois P. Heinz_, Jul 09 2012

%t f[n_] := Length[Select[IntegerPartitions[2 n], First[#] <= n - 1 &]]; Table[f[n], {n, 1, 34}] (* A209815 *)

%t b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i]]]]; a[n_] := b[2*n, n-1]; Table [a[n], {n, 1, 50}] (* _Jean-François Alcover_, Oct 28 2015, after _Alois P. Heinz_ *)

%o (Haskell)

%o a209815 n = p [1..n-1] (2*n) where

%o p _ 0 = 1

%o p [] _ = 0

%o p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m

%o -- _Reinhard Zumkeller_, Nov 14 2013

%Y Cf. A209816.

%Y Cf. A231429.

%K nonn

%O 1,3

%A _Clark Kimberling_, Mar 13 2012

%E More terms from _Alois P. Heinz_, Jul 09 2012