Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A131408
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A131408 Repeated integer partitions or nested integer partitions. +0
5
1, 2, 5, 14, 35, 95, 248, 668, 1781, 4799, 12890, 34766, 93647, 252635, 681272, 1838135, 4958738, 13379885, 36100214, 97409045, 262833314, 709207394, 1913652308, 5163654671, 13933178390, 37596275726, 101446960109 (list; graph; listen)
OFFSET

1,2

COMMENT

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

LINKS

Thomas Wieder, Homepage.

Thomas Wieder, (Old) Homepage.

FORMULA

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

EXAMPLE

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

MAPLE

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 (mathar(AT)strw.leidenuniv.nl), Aug 07 2008

PROGRAM

(VB) Sub test_A131408()

Dim n As Long, Result As Long

For n = 1 To 9

Result = A131408(n)

Debug.Print n, Result

Cells(3, 3 + n) = Result

Next n

End Sub

Public Function A131408(n As Long)

Dim imsgbox As Integer

Dim i As Long, j As Long, Summe As Long

If n = 0 Then

A131408 = 0

Exit Function

ElseIf n = 1 Then

A131408 = 1

Exit Function

ElseIf n = 2 Then

A131408 = 2

Exit Function

ElseIf n > 2 And n < 13 Then

'Summe = Bell(n)

Summe = ZahlAllerPartitionen(n)

For j = 2 To n - 1

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

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

Next j

Else

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

End

End If

A131408 = Summe

End Function

Public Function ZahlAllerPartitionen(n As Long)

Dim k As Long

ZahlAllerPartitionen = 0

For k = 1 To n

ZahlAllerPartitionen = ZahlAllerPartitionen + ZahlPartitionen(n, k)

Next k

End Function

Sub TestZahlPartitonenInTeile()

Dim n As Long, k As Long, Resultat As Long

n = 8

k = 4

Resultat = ZahlPartitionen(n, k)

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

End Sub

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

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

Dim imsgbox As Integer

If n > 2147483648# Or k > 2147483648# Then

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

End

End If

If (n < 0 Or k < 0) Then

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

End

End If

'If k > n Then

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

'End

'End If

If k = 1 Then

ZahlPartitionen = 1

Exit Function

ElseIf k = n Then

ZahlPartitionen = 1

Exit Function

ElseIf k > n Then

ZahlPartitionen = 0

Exit Function

End If

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

End Function

CROSSREFS

Cf. A131407.

Sequence in context: A090803 A018015 A080039 this_sequence A137917 A102714 A087223

Adjacent sequences: A131405 A131406 A131407 this_sequence A131409 A131410 A131411

KEYWORD

nonn

AUTHOR

Thomas Wieder (thomas.wieder(AT)t-online.de), Jul 09 2007

EXTENSIONS

Edited and extended by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Aug 07 2008

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research