### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Puzzle #52: Bus change | |

Jim Randell on Enigma 967: Prime cubes | |

GeoffR on Enigma 1707: Making progr… | |

Jim Randell on Enigma 1707: Making progr… | |

Jim Randell on Tantalizer 409: Fe, Fi, Fo,… |

### Archives

### Categories

- article (11)
- enigma (1,364)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (47)
- site news (58)
- tantalizer (92)
- teaser (7)

### Site Stats

- 231,894 hits

The following Python program calculates the smallest value that it is not possible to make using only three stamps of given denominations. It then looks for sets of denominations that satisfy the requirements of the puzzle. It runs in 101ms.

Run:[ @repl.it ]Solution:Denominations of (1, 4, 5) can make values from 1 to 15. Denominations of (1, 4, 7, 8) can make values from 1 to 24.The smallest denomination needs to be 1, and if the largest possible amount is made from the 3 copies of the largest denomination then that denomination needs to be a third of the largest possible amount.

So. Where is enigma and can I install it with pip?

The

enigma.pylibrary is available here [ link ] (also on GitHub [ link ]).It is just a single file, so you can install it how you like.

Thanks Jim . Lots of really great stuff in enigma.py library.

I hope you find it useful. Let me know if you come across any problems, or if you’d like the documentation expanded in any particular area.

By coincidence (or possibly not), both the September and October puzzles from IBM Ponder This are “change making” puzzles.

My solution to Three Stamps is adapted from my solution to the October Ponder This, which in turn is adapted from the Dynamic Programming section of pythonDS, https://runestone.academy/runestone/books/published/pythonds/Recursion/DynamicProgramming.html