I have a doubt about the complexity of the recursive method. This should not be n^6. The worst case should be 6^n instead of n^6.