PROJECT EULER · #0828
Numbers Challenge
It is a common recreational problem to make a target number using a selection of other numbers. In this problem you will be given six numbers and a target number.
For example, given the six numbers
This uses all six numbers. However, it is not necessary to do so. Another solution that does not use the
Define the score of a solution to be the sum of the numbers used. In the above example problem, the two given solutions have scores
When combining numbers, the following rules must be observed:
- Each available number may be used at most once.
- Only the four basic arithmetic operations are permitted:
, , , . - All intermediate values must be positive integers, so for example
is never permitted as a subexpression (even if the final answer is an integer).
The attached file number-challenges.txt contains 200 problems, one per line in the format:
where the number before the colon is the target and the remaining comma-separated numbers are those available to be used.
Numbering the problems 1, 2, ..., 200, we let
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.