This is also posted at http://www.javaprogrammingforums.com/algorithms-recursion/9741-recursion-ouput-not-coming-value-more-than-40-a.html#post36207