looping through possible combinations of McNuggets packs of 6, 9 and 20
cbrown at cbrownsystems.com
cbrown at cbrownsystems.com
Wed Aug 18 14:40:57 EDT 2010
On Aug 18, 10:52 am, Baba <raoul... at gmail.com> wrote:
> Hi Chas
>
> Thanks for that and i agree on your last remark :)
>
> re the number of required consecutive passes required:
>
> The number of required consecutive passes is equal to the smallest
> number because after that you can get any amount of nuggets by just
> adding the smallest nugget pack to some other number.
>
> This is only true if gcd(a,b,c)=1.
>
> Thanks to all for the help in getting to the bottom of the exercise. I
> have truly enjoyed this and most importantly i have learned some new
> things. Hadn't really done any mathematics in a long time and only
> starting programming so this was good to get up to speed.
>
> kind regards to everyone!
> Baba
Happy to be of service!
Cheers - Chas
More information about the Python-list
mailing list