Digit Puzzle Solver

Problem Statement

Find all solutions where:

  • A 2-digit number multiplied by a 3-digit number equals a 5-digit number
  • All digits 0-9 are used exactly once across all three numbers
  • The first digit of the 5-digit result is 1

Solutions Found

The solver found 6 valid solutions:

Solution 2-digit 3-digit 5-digit Result Verification
1 27 594 16038 27 × 594 = 16038
2 36 495 17820 36 × 495 = 17820
3 39 402 15678 39 × 402 = 15678
4 45 396 17820 45 × 396 = 17820
5 52 367 19084 52 × 367 = 19084
6 54 297 16038 54 × 297 = 16038

Verification

Each solution satisfies all constraints:

Constraint 1: Correct Multiplication

All multiplications are verified to produce the correct 5-digit result.

Constraint 2: Unique Digits (0-9)

Each solution uses all digits 0-9 exactly once across the three numbers:

Example - Solution 1 (27 × 594 = 16038):

  • Digits used: 2, 7, 5, 9, 4, 1, 6, 0, 3, 8
  • All digits 0-9 present: ✅

Constraint 3: 5-digit Result Starting with 1

All results are 5-digit numbers in the range 15,000-19,999:

  • 16038 ✅
  • 17820 ✅
  • 15678 ✅
  • 19084 ✅

Key Observations

Multiple Solutions

  • The puzzle has 6 valid solutions, not just one
  • This demonstrates the richness of the constraint space

Duplicate Results

  • 16038 appears twice (solutions 1 and 6)
  • 17820 appears twice (solutions 2 and 4)
  • This shows different factor pairs can produce the same result

Range Analysis

  • 2-digit numbers: Range from 27 to 54
  • 3-digit numbers: Range from 297 to 594
  • 5-digit results: Range from 15,678 to 19,084

Mathematical Properties

  • All 5-digit results are in the 15,000-19,000 range
  • The smallest 2-digit number used is 27
  • The largest 2-digit number used is 54
  • Results are well-distributed across the valid range

Algorithm

The solver uses a brute-force approach:

  1. Iterate through all 2-digit numbers (10-99)
  2. Iterate through all 3-digit numbers (100-999)
  3. Calculate the product
  4. Check if product is 5-digit and starts with 1
  5. Verify all digits 0-9 are used exactly once
  6. Collect valid solutions

Files

  • solve_puzzle.py - Main solver program
  • PUZZLE.md - This documentation

Running the Solver

solve_puzzle-py.txt

python3 solve_puzzle.py

Conclusion

The conjecture that the first digit of the 5-digit number is 1 was correct. The puzzle has multiple valid solutions, each demonstrating the elegant constraint satisfaction where all digits 0-9 are used exactly once across the multiplication problem.

Leave a Reply