# Countdown to 2016

DevFeed: [Countdown to 2016](<https://devfeed.tech/articles/countdown-to-2016-40528.md>)

Original publisher: [Read original article](<http://nbviewer.ipython.org/url/norvig.com/ipython/Countdown.ipynb>)

Published: 2016-01-06T00:00:00Z

Content type: article

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Calculate Pi](<https://devfeed.tech/topics/calculate-pi.md>), [polynomials](<https://devfeed.tech/topics/polynomials.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>)

Tags: [2016](<https://devfeed.tech/tags/2016.md>), [alex](<https://devfeed.tech/tags/alex.md>), [dynamic-programming](<https://devfeed.tech/tags/dynamic-programming.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>)

## AI overview

Using dynamic programming to build and cache expressions for every contiguous countdown subsequence, the author solves the 2016 puzzle with four basic operations and parentheses in about 56 seconds in Python. The expression is (10 + 9 x 8 x 7 − 6 − 5) x 4 + 3 + 2 − 1. A floating-point count gives 30,066 solutions, but exact rational arithmetic changes that to 44,499; the author cautions that this still needs independent verification and depends on how "distinct" is defined. The post also explores four and five 4s or 5s with exponentiation, concatenation, decimals, roots, factorials, floor and ceiling. With five 5s and these added operations, its search reports every integer from 0 through 23,307 as makeable, with 23,308 the first gap. For exponentiation and roots it uses floats, accepting possible rounding errors, and limits certain exponent forms to control problematic values.

## Source excerpt

Solving the equation 10 _ 9 _ 8 _ 7 _ 6 _ 5 _ 4 _ 3 _ 2 _ 1 = 2016. From an Alex Bellos puzzle.