31 is prime. No tree.
43 is prime. No tree.
77 7,11
29 is prime. No tree.
38 2,19
273 91,3 13,7,3
37 is prime. No rainbow. Sorry.
Since 5 is a prime, it looks like the end of a branch.
You look for a perfect square among its factors; if you factor it into prime factors, you would look for a repeated prime factor. Then you take that factor out of the root sign (taking the square root of it, while you do it).
Pretty small. 35 5,7
3 * 13 (both prime numbers)
13 is already prime. It doesn't need a tree.