A full -ary tree is a tree with a single root node, such that every node is either a leaf or has exactly ordered children. The height of a -ary tree is the number of edges in the longest path from the root to a leaf.
For instance, there is one full 3-ary tree of height 0, one full 3-ary tree of height 1, and seven full 3-ary trees of height 2. These seven are shown below.
For integers and with and , define to be the number of full -ary trees of height or less. Thus, , , and . Also, , , and .
Define to be the set of positive integers such that divides for some integer . For instance, the above values show that 1, 2, and 5 are in and 1, 2, 3, and 9 are in .
Let where the intersection is taken over all primes . Finally, define to be the sum of all elements of not exceeding . You are given that and .