IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2025/kurdyukov - Most likely to count

Solves number puzzles

Author:

Award presentation:

Watch the Our Favorite Universe YouTube show for this entry:

IOCCC29 - 2025/kurdyukov - Most likely to count

To build:

    make all

To use:

    ./prog number .. 0 answer ..

Try:

    ./try.sh

Judges’ remarks:

How many arithmetic ways can we form numbers out of other numbers? The answer is a great deal. But to find the shortest mathematical expression: that is more of a challenge. To do that in only 1196 bytes of C code: that is impressive!

A fun challenge

Please checkout the fun challenge(s) for this winning entry.

Author’s remarks:

Magic Equations

Usage

    ./prog 7 77 777 0 2025 2026 2027 2028 2029
    (777 / 7 - 7) * (77 + 7) / 7 + 777 = 2025
    777 / 7 * 77 / 7 + 777 + 77 - 7 * 7 = 2026
    777 + 777 - 77 + 77 * 7 + 77 / 7 = 2027
    (77 + 7 / 7) * (7 + 7 + (77 + 7) / 7) = 2028
    77 * (7 + 7 + 77 / 7) + 777 / 7 - 7 = 2029

The program finds the shortest mathematical expression that uses numbers from the first list and +-*/ operators along with parentheses to represent numbers in the second list. Lists are separated by a zero.

Notes

Inventory for 2025/kurdyukov

Primary files

Secondary files


 Jump to: top