Skip to content

Add Wolfram Mathematica notebook solving the 27-matchstick division puzzle#3

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/solve-segment-problem
Draft

Add Wolfram Mathematica notebook solving the 27-matchstick division puzzle#3
Copilot wants to merge 2 commits intomainfrom
copilot/solve-segment-problem

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 9, 2026

88 ÷ 31 = 14 uses 27 matchstick segments (7-segment display digits) but is mathematically invalid. The task is to rearrange those 27 segments into a valid equation with no segments added or removed.

Changes

  • New cerillos.nb — Mathematica notebook that:
    • Defines a segment-count lookup for digits 0–9
    • Verifies the original equation's segment total (27) and invalidity
    • Exhaustively searches A ÷ B = C for all integer triples ≤ 999 where contarSegmentos(A) + contarSegmentos(B) + contarSegmentos(C) == 27
    • Presents all solutions in a grid; isolates 2-digit ÷ 2-digit results

Key findings

8 solutions preserve the 2-digit ÷ 2-digit structure; the closest to the original (keeping 88 unchanged):

Equation Segments
88 ÷ 44 = 2 14 + 8 + 5 = 27
68 ÷ 34 = 2 13 + 9 + 5 = 27
86 ÷ 43 = 2 13 + 9 + 5 = 27
66 ÷ 22 = 3 12 + 10 + 5 = 27

In 88 ÷ 44 = 2: divisor 31→44 (digit 3 gains a segment to become 4; digit 1 gains two segments to become 4) and result 14→2 (digit 1 disappears; digit 4 loses one segment to become 2). Net segment delta: zero.

segmentos = <|0->6, 1->2, 2->5, 3->5, 4->4, 5->5, 6->6, 7->3, 8->7, 9->6|>;
contarSegmentos[n_Integer] := Total[segmentos /@ IntegerDigits[n]]

(* Search: all valid A÷B=C with 27 total segments *)
Reap[Do[
  If[Divisible[a,b] &&
     contarSegmentos[a] + contarSegmentos[b] + contarSegmentos[a/b] == 27,
     Sow[{a, b, a/b}]],
  {a,1,999}, {b,1,a}]]

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…puzzle

Co-authored-by: calculuscalculus <120034106+calculuscalculus@users.noreply.github.com>
Copilot AI changed the title [WIP] Resolve segment problem with matches Add Wolfram Mathematica notebook solving the 27-matchstick division puzzle Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants