This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A131408 Repeated integer partitions or nested integer partitions. 7

%I

%S 1,2,5,14,35,95,248,668,1781,4799,12890,34766,93647,252635,681272,

%T 1838135,4958738,13379885,36100214,97409045,262833314,709207394,

%U 1913652308,5163654671,13933178390,37596275726,101446960109

%N Repeated integer partitions or nested integer partitions.

%C See A131407 for the labeled case (with much more explanation).

%C Also the number of sequences of distinct integer partitions (y_1, ..., y_k), containing no partitions of the form (111..1) other than (1), such that sum(y_1) = n and length(y_i) = sum(y_{i+1}) for all i = 1, ..., k-1. - _Gus Wiseman_, Jul 20 2018

%H Alois P. Heinz, <a href="/A131408/b131408.txt">Table of n, a(n) for n = 1..750</a>

%F a(1)=1, a(2)=2, a(n) = A000041(n) + sum_{i=2..n-1} A008284(n,i)*a(i).

%F a(n) ~ c * d^n, where d = A246828 = 2.69832910647421123126399866618837633..., c = 0.232635324064951140265176690908381464098550827908380222089145... . - _Vaclav Kotesovec_, Sep 04 2014

%e Let denote * an unlabeled element. Then a(n=3)=5 because we have [ *,*,* ], [ *, * ][ * ], [[ *,* ]][[ * ]], [[ *,* ][ * ]], [ * ][ * ][ * ].

%e From _Gus Wiseman_, Jul 20 2018: (Start)

%e The a(4) = 14 sequences of integer partitions:

%e (4), (31), (22), (211),

%e (4)(1), (31)(2), (22)(2), (211)(3), (211)(21),

%e (31)(2)(1), (22)(2)(1), (211)(3)(1), (211)(21)(2),

%e (211)(21)(2)(1).

%e (End)

%p A000041 := proc(n) combinat[numbpart](n) ; end: A008284 := proc(n,k) if k = 1 or k = n then 1; elif k > n then 0 ; else procname(n-1,k-1)+procname(n-k,k) ; fi ; end: A131408 := proc(n) option remember; local i ; if n <= 2 then n; else A000041(n)+add(A008284(n,i)*procname(i),i=2..n-1) ; fi ; end: for n from 1 to 40 do printf("%d,",A131408(n)) ; od: # _R. J. Mathar_, Aug 07 2008

%t t[_, 1] = 1; t[n_, k_] /; 1 <= k <= n := t[n, k] = Sum[t[n-i, k-1], {i, 1, n-1}] - Sum[t[n-i, k], {i, 1, k-1}]; t[_, _] = 0; a[1]=1; a[2]=2; a[n_] := a[n] = PartitionsP[n] + Sum[t[n, i]*a[i], {i, 2, n-1}]; Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Feb 02 2017 *)

%t roo[n_]:=If[n==1,{{{1}}},Join@@Cases[Most[IntegerPartitions[n]],y_:>Prepend[(Prepend[#,y]&/@roo[Length[y]]),{y}]]];

%t Table[Length[roo[n]],{n,10}] (* _Gus Wiseman_, Jul 20 2018 *)

%o (VB) Sub test_A131408()

%o Dim n As Long, Result As Long

%o For n = 1 To 9

%o Result = A131408(n)

%o Debug.Print n, Result

%o Cells(3, 3 + n) = Result

%o Next n

%o End Sub

%o Public Function A131408(n As Long)

%o Dim imsgbox As Integer

%o Dim i As Long, j As Long, Summe As Long

%o If n = 0 Then

%o A131408 = 0

%o Exit Function

%o ElseIf n = 1 Then

%o A131408 = 1

%o Exit Function

%o ElseIf n = 2 Then

%o A131408 = 2

%o Exit Function

%o ElseIf n > 2 And n < 13 Then

%o 'Summe = Bell(n)

%o Summe = ZahlAllerPartitionen(n)

%o For j = 2 To n - 1

%o 'Summe = Summe + Stirling2(n, j) * A131408(j)

%o Summe = Summe + ZahlPartitionen(n, j) * A131408(j)

%o Next j

%o Else

%o imsgbox = MsgBox("Illegal input for argument *** n *** !", vbOKOnly, "A131408")

%o End

%o End If

%o A131408 = Summe

%o End Function

%o Public Function ZahlAllerPartitionen(n As Long)

%o Dim k As Long

%o ZahlAllerPartitionen = 0

%o For k = 1 To n

%o ZahlAllerPartitionen = ZahlAllerPartitionen + ZahlPartitionen(n, k)

%o Next k

%o End Function

%o Sub TestZahlPartitonenInTeile()

%o Dim n As Long, k As Long, Resultat As Long

%o n = 8

%o k = 4

%o Resultat = ZahlPartitionen(n, k)

%o Debug.Print "TestZahlPartitonen: n,k,Resultat:", n, k, Resultat

%o End Sub

%o Public Function ZahlPartitionen(n As Long, k As Long)

%o ' compute recursively the number of partitions of n into k parts.

%o Dim imsgbox As Integer

%o If n > 2147483648# Or k > 2147483648# Then

%o imsgbox = MsgBox("n and k need to be smaller than 2147483648 !", vbOKOnly, "ZahlPartitionen")

%o End

%o End If

%o If (n < 0 Or k < 0) Then

%o imsgbox = MsgBox("n and k need to be greater than 0 !", vbOKOnly, "ZahlPartitionen")

%o End

%o End If

%o 'If k > n Then

%o 'imsgbox = MsgBox("k needs to be <= n !", vbOKOnly, "ZahlPartitionen")

%o 'End

%o 'End If

%o If k = 1 Then

%o ZahlPartitionen = 1

%o Exit Function

%o ElseIf k = n Then

%o ZahlPartitionen = 1

%o Exit Function

%o ElseIf k > n Then

%o ZahlPartitionen = 0

%o Exit Function

%o End If

%o ZahlPartitionen = ZahlPartitionen(n - 1, k - 1) + ZahlPartitionen(n - k, k)

%o End Function

%Y Cf. A022811, A022818, A131407, A246828.

%K nonn

%O 1,2

%A _Thomas Wieder_, Jul 09 2007

%E Edited and extended by _R. J. Mathar_, Aug 07 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified March 20 07:27 EDT 2019. Contains 321345 sequences. (Running on oeis4.)