Sunday Times Teaser 2992 – Crystal Cleavage Calamity!
by Stephen Hogg
Published January 26 2020 (link)
My “mystic” crystal stood on its triangular end face, with every side of the triangle being less than 10cm. It had three vertical sides and an identical triangular top end face, with the height being under 50cm. Unfortunately, during dusting, it fell and broke in two. The break was a perfect cleavage along an oblique plane that didn’t encroach on the end faces, so I then had two, pointed, pentahedral crystals.
Later, I found that the nine edge lengths, in cm, of one of these were all different whole numbers — the majority prime — and their total was also a prime number. Curiously, the total of the nine, whole-number, edge lengths, in cm, of the other piece was also a prime number.
What was the total for this latter piece?
-
Brian Gladman permalink12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152from itertools import permutations, productfrom collections import defaultdictfrom number_theory import Primes, pythag# primes less than the maximum sum of nine edge lengthsprms = Primes().set(304)# The prism's vertical sides are rectangles with pythagorean# triangles above them - index possible triangles with sides# less than 51 on their non-hypotenuse sides (less than 10)b_to_vt = defaultdict(list)for a, b, c in pythag(51):if a < 10:b_to_vt[a].append((b, c))if b < 10:b_to_vt[b].append((a, c))# consider possible combinations of edges for the base trianglefor b3 in permutations(b_to_vt.keys(), 3):# avoid duplicate solutions and ensure a valid base triangleif b3[0] < b3[1] and b3[1] - b3[0] < b3[2] < b3[1] + b3[0]:# consider possible pythagorean triangles for the prism sidesfor p3 in product(*(b_to_vt[x] for x in b3)):# the vertical triangle heights and top edge lengthsh3, t3 = zip(*p3)# the triangles must form the prismif h3[0] + h3[1] == h3[2]:# now consider the prism heightfor h in range(h3[2] + 1, 50):# form the three vertical edgesv3 = h - h3[2], h - h3[0], hedges = b3 + t3 + v3# the edge lengths are all different, their sum is a# prime and the majority of them are primeif (len(set(edges)) == 9 and sum(edges) in prms andsum(x in prms for x in edges) > 4):# consider the unbroken prism heightfor ht in range(h + 1, 50):# calculate the (prime) edge sum of the other broken piecesms = sum(b3) + sum(t3) + 3 * ht - sum(v3)if sms in prms:print(f"sum = {sms}, height = {ht}, edges: base = {b3}, "f"top = {t3}, vertical = {v3}")
-
GeoffR permalink1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556from number_theory import is_prime# return the square root of a perfect square otherwise 50# (to signal failure)def is_psqr(x):return r if (r := int(x ** 0.5 + 0.5)) ** 2 == x else 50# choose base triangle numbers (a, b, c)for a in range(1, 10):for b in range(a + 1, 10):# ensure a valid base trianglefor c in range(1, a + b):# the height of the first vertical edgefor x in range(1, 50):# the cleavage plane edges corresponding to (a, b, c)# are (d, e, f)for d in range(a + 1, 50):# use the lengths of edges a and d to calculate the# height difference between x and y and hence yy = x + is_psqr(d * d - a * a)if y > 50:continuefor e in range(max(d, b) + 1, 50):# use the lengths of edges b and e to calculate the# height difference between y and z and hence zz = y + is_psqr(e * e - b * b)if z > 50:continue# calculate the remaining cleavage edge from the base# edge c and the height difference between z and xf = is_psqr(c * c + (z - x) ** 2)if f >= 50:continue# the edge lengths are all different, their sum is prime# and the majority of them are primeedges = (a, b, c, d, e, f, x, y, z)if not ( len(set(edges)) == 9 and is_prime(sum(edges))and sum(is_prime(x) for x in edges) > 4):continue# now consider the other prismfor ht in range(z + 1, 50):t = sum(edges[:6]) + 3 * ht - sum(edges[6:])if is_prime(t):print(f"Base triangle sides: {a},{b},{c}")print(f"Heights to fracture plane: {x},{y},{z}")print(f"Sides of fracture plane: {d},{e},{f}")print(f"Edge total length of 2nd piece: {t}")print()