Hi. This is a program figuring out the highest number of chicken nuggets that is impossible to get through any combination of 3 packs of nuggets sized 6,9,20. once I find a streak of 6 i know that every higher number is possible by adding one more 6 pack to a previous combination. Why is this program i wrote counting some numbers twice, despite that i have a mechanism to move forward when a possible combination is found. Thanks for any help.

code is here

http://pastebin.com/eFV99VSG