I have an ongoing project investigating the Fibonacci sequence, this is just a personal project, I have created a binary tree class which makes a binary tree of the Fibonacci call graph, so for f(3) I generate the tree:

Binary Tree

I want to create a method of my tree class get_partitions() that traverses the tree to generate partitions of the root value, I regard here summands that differ in order as different partions; so for the example here of f(3), the get_partitions() method would traverse the tree and yield:

Partion 1: 2,1
Partion 2: 2,1,0
Partion 3: 1,1,1
Partion 4: 1,1,1,0
Partion 5: 1,0,1,1
Partion 6: 1,0,1,1,0

As ultimately I want to enumerate every permutation of Fibonacci numbers that Partition the root value, in this case 3, so for Partition 1 enumerated would be (2,1),(1,2), or Partion 2 would be enumerated (2,1,0),(2,0,1),(1,2,0),(1,0,2),(0,2,1),(0,1,2), etc…

[Edit 1] My concern is with Partion 4 and Partion 5 in this examples as enumerating all combinations of these partions would yield duplicate partions.

Would it be correct that the number of combinations for a given root value would yield a Catalan number?

My Tree class is:

class FibTree(object):
"""Class which builds binary tree from Fibonacci function call graph"""
def __init__(self, n, parent=None, level=None, i=None):
    if level is None:
        level = 0
    if i is None:
        i = 1
    self.n = n
    self.parent = parent
    self.level = level
    self.i = i # Node index value
    if n < 2:
        self.left = None
        self.right = None
        self.value = n
    else:
        self.left =
Edit
Report