Teaser 2886: Metal arithmetic
From The Sunday Times, 14th January 2018 [link] [link]
The area of one face of a hot, steel cuboid block was a single-figure whole number of square feet; and it was within one per cent of this after cooling and contraction. When cool, it was cut, parallel to this face, into blocks of the same width and height, but unequal length. For the first cut block, its width, height and length, in inches, were different two-figure whole numbers with only four factors (including 1 and the number), and they had only the factor 1 in common. The same applied to the other cut blocks. Curiously, the six digits of the width, height and length of the first cut block were also all different.
In ascending order, what were the dimensions, in inches, of the shortest block?
[teaser2886]
Jim Randell 1:16 pm on 25 November 2019 Permalink |
This Python program runs in 81ms.
Run: [ @replit ]
from enigma import (irange, divisors, subsets, divc, is_duplicate, printf) # find 2-digit numbers with exactly 4 divisors ns = dict() for n in irange(10, 99): fs = divisors(n) if len(fs) == 4: ns[n] = set(fs) # check x and y share exactly k divisors def check(x, y, k=1): return len(ns[x].intersection(ns[y])) == k # find x, y dimensions for (x, y) in subsets(ns.keys(), size=2): # cross section is within 1% of a single digit number of square feet A = x * y k = divc(A, 144) if k > 9: continue if not (100 * A > 99 * 144 * k): continue # x and y share only one divisor if not check(x, y): continue # find possible values for z dimension zs = list(z for z in ns.keys() if z != x and z != y and check(x, z) and check(y, z)) # it is implied there are at least 3 blocks if not (len(zs) > 2): continue # and there must be a z such that x, y, z consist of 6 different digits if all(is_duplicate(x, y, z) for z in zs): continue # output dimensions of the smallest block printf("x={x} y={y} z={z} [A={A} k={k} zs={zs}]", z=min(zs))Solution: The shortest block measured 21 × 34 × 55 inches.
The 21 in. × 34 in. face has an area of 714 sq. in., when heated up the face expands to exactly 5 square feet = 720 sq. in.
The area of the face when cold is 99.17% of this area.
The 4 divisors of 21 are: 1, 3, 7, 21.
The 4 divisors of 34 are: 1, 2, 17, 34.
The cold block was cut into lengths of 55 in., 65 in., 95 in. (it is implied the block was cut into at least 3 pieces).
The 4 divisors of 55 are: 1, 5, 11, 55.
The 4 divisors of 65 are: 1, 5, 13, 65.
The 4 divisors of 95 are: 1, 5, 19, 95.
So the first block cut could be: 21 × 34 × 65, using the digits: 1, 2, 3, 4, 5, 6, or: 21 × 34 × 95, using the digits: 1, 2, 3, 4, 5, 9.
And the shortest block is 21 × 34 × 55, which repeats the digit 5.
LikeLike