I am a high school student (so sorry if my thinking is way off) with a problem related to chemistry essentially dealing with the number of ways you can arrange carbon atoms in a alkane. I saw that this was related to mathematical trees and so I started working towards creating a function that will return the number of unique structures you can make given a certain number of carbon atoms. In math speak this translates to: Given $n$ vertices how many ways can you construct unique trees (no rotational, reflectional or translational symmetry) so that no vertex has more than four connections.
Note:
The first image is not a branch because in order to be a branch there must be at least three connections, so that there is more than one path to follow if you were travelling along the chain. My thinking was to start by defining a fixed length $c \leq n$ and determine how many ways I can branch off of $c$ so that in total there are $n$ vertices without creating a chain greater than $c$ by these branches.
Eg. if $c=n$ then there is only one way to construct a unique tree (obviously).
if $c=n-1$ then there is $\left\lceil\frac{n}{2}\right\rceil$ ways to construct a unique tree.
The idea I had was to continue this process until some limit where you cannot branch off of $c$ with $n-c$ vertices and maintain the maximum continuous chain length $c$.
The formula (which is still missing something) is:
$$z\left(n\right) = 1 + \sum_{k=1}^{a_n} \sum_{i=0}^{k-\left\lfloor\frac{k}{2}\right\rfloor} \left\lceil \frac{n-k}{2} \right\rceil - \left(k-i\right) + \left(k-1\right)\left[ {{n-(k+2)}\choose{k-i}} - {{\left\lceil \frac{n}{2} \right\rceil - (k+2)}\choose{k-i}}\right]$$.
Where $a_n$ is a sequence defined by the smallest chain $c$ that can exist while maintaining the maximum length of $c$, $k$ is the difference $n-c$ and $i$ represents the idea of moving a branch vertex onto the other connection on the main chain vertex in order to lower the length of the chain it forms. The function Should return $(1,1,1,2,3,5,9,18)$ for the first 8 inputs.
As I said before the formula is wrong, but I don't know how to include the information I am missing. Any input would be appreciated, thank you!
