First of all, let's prove that for each tree the number of its automorphisms is the product of some small factorials. The center of the tree has either one vertex or two vertices. Each automorphism must map the center onto itself. If your tree happens to have a center with two vertices, insert a new one between them, you'll get a tree with a single-vertex center and the same number of automorphisms. Now consider that the tree is rooted in its center vertex. For each node, we can divide its children into equivalence classes: two children are equivalent if an automorphism can swap their labels (in other words, if their rooted subtrees happen to be isomorphic). Clearly, within each equivalence class, each permutation of the childrens' labels leads to a valid automorphism. The choice can be done independently in each of the nodes, therefore the total number of automorphisms is always a product of some factorials. This gives us a necessary condition for a solution to exist: we have to be able to write the given number "age" as a product of factorials. As the largest factorial we need to consider is 19!, there are only few possibilities to check, and we can do that using brute force. The condition turns out to be sufficient as well: if we know how to write "age" as a product of small factorials, we can use those factorials to construct a tree with the correct number of automorphisms. Our construction will be such that the number of nodes in our tree will never exceed 200. Here's one sample construction as ASCII art: 0 | 1 | +-+-+-+-+ | | | | | 2 3 4 5 6 | +-+-+ | | | 7 8 9 (The children of vertex 1 are 2, 3, 4, 5, and 6.) The above tree has 4! * 3! automorphisms. The equivalence classes are {2,3,4,5} and {7,8,9}. Surely you can see how this construction generalizes :)