Project Euler Lab - Problem 563

#563 - Robot Welders

● AdvancedOfficial difficulty: 40%PointsTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

A company specialises in producing large rectangular metal sheets, starting from unit square metal plates. The welding is performed by a range of robots of increasing size. Unfortunately, the programming options of these robots are rather limited. Each one can only process up to \(25\) identical rectangles of metal, which they can weld along either edge to produce a larger rectangle. The only programmable variables are the number of rectangles to be processed (up to and including \(25\)), and whether to weld the long or short edge.

For example, the first robot could be programmed to weld together \(11\) raw unit square plates to make a \(11 \times 1\) strip. The next could take \(10\) of these \(11 \times 1\) strips, and weld them either to make a longer \(110 \times 1\) strip, or a \(11 \times 10\) rectangle. Many, but not all, possible dimensions of metal sheets can be constructed in this way.

One regular customer has a particularly unusual order: The finished product should have an exact area, and the long side must not be more than \(10\%\) larger than the short side. If these requirements can be met in more than one way, in terms of the exact dimensions of the two sides, then the customer will demand that all variants be produced. For example, if the order calls for a metal sheet of area \(889200\), then there are three final dimensions that can be produced: \(900 \times 988\), \(912 \times 975\) and \(936 \times 950\). The target area of \(889200\) is the smallest area which can be manufactured in three different variants, within the limitations of the robot welders.

Let \(M(n)\) be the minimal area that can be manufactured in exactly \(n\) variants with the longer edge not greater than \(10\%\) bigger than the shorter edge. Hence \(M(3) = 889200\).

Find \(\sum_{n=2}^{100} M(n)\).

This problem is taken from Project Euler, Problem 563.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=563. Published Sunday, 5th June 2016, 04:00 am. Solved by 413 members at time of mirroring.

Why this is useful

Algorithmic Development. Graph/state-space search transfers to routing, dependency resolution, and execution-path optimisation (Phases 16, 17).

We classify relevance honestly - not every Euler problem is a trading application.

Learning mode

Pick how much scaffolding you want. Your choice is remembered per problem.

Scratchpad

Mathematical notes, formulas, pseudocode, hypotheses, complexity notes. Saved automatically with your progress.

Python workbench

Tier C - reduced scale in browser; full scale in notebook
Browser runs a reduced, clearly-labelled educational scale; the original scale is provided in a local notebook.

Real Python (Pyodide) in a sandboxed Web Worker - no network, no filesystem, no DOM access. Ctrl/Cmd+Enter runs. Escape leaves the editor. Stop terminates the worker.

Python runtime not loaded (it boots on first run - a one-time local load).

Check your answer

Answers are checked against a salted hash held in a separate file - not printed in this page. This prevents accidental spoilers; it is not cryptographic protection (see the build notes).

Progressive hints

Confidence

Low confidence schedules this problem for spaced review, even if you solved it.

Reference solution

Spoiler
The complete original explanation (interpretation, naive approach, insight, proof, complexity, Python implementation, tests, common mistakes, alternatives) is hidden and lazy-loaded. Reveal it only after a meaningful attempt - the struggle is where the learning happens.