## A Holiday Brain Teaser

**From The Sunday Times, 4th August 1957** [link]

The series below is peculiar in that if any two of the numbers are multiplied together and added to unity, the result is a perfect square:

1, 3, 8

Let

A[4], be a fourth number in this series. There is a further series with the same characteristic:8,

B[2], 190,B[4]in which not only is

B[1], the same asA[3], butB[2]is also the same asA[4].What is

B[4]?(

Note:zero is excluded)

This is one of the occasional *Holiday Brain Teasers* published in *The Sunday Times* prior to the start of numbered *Teasers* in 1961. A prize of £5 was offered for a solution to the puzzle, and a further prize of £25 for finding *A[5]* or *B[5]*.

[teaser-1957-08-04] [teaser-unnumbered]

## Jim Randell 11:28 am

on17 October 2021 Permalink |I am assuming we are looking for a sequence of increasing integers.

With computers we can easily calculate the next terms.

Even a simple program runs in less than a second:

But we can be a little bit cleverer, and this gives us a program that runs in just a few milliseconds:

Run:[ @replit ]Solution:A[4] = 120. B[4] = 730236.See OEIS A030063 [@oeis], which says that the sequence cannot be extended further (although there is a further term in rationals).

The following was published in the 18th August 1957 edition of

The Sunday Times[link]:LikeLike

## Jim Randell 12:10 pm

on17 October 2021 Permalink |Euler found an infinite family of such 4-tuples:

(Which means that any pair of values from one quadruple can be used to seed another).

The

Asequence of the puzzle is given by:a = 1; b = 3; r = 2.And the

Bsequence is given by:a = 8; b = 120; r = 31.In 1969 it was shown that the {1, 3, 8, 120} quadruple cannot be extended with another value, and in 2016 (a mere 59 years after the puzzle was set) it was proved that no

Diophantine quintupleexists (see: [ @wikipedia ]). So the £25 prize was safe.LikeLike

## Jim Randell 5:48 pm

on20 October 2021 Permalink |And here is a solution using

Pell’s equations(it uses the [[`pells()`

]] routine written forTeaser 2994), which means fewer candidate numbers are considered when looking for solutions.LikeLike

## GeoffR 3:09 pm

on17 October 2021 Permalink |The best run-time I could get was 12.81 sec on an I9 processor. The Geocode solver took much longer. I had to use the answer to fix variable upper bounds.

LikeLike

## A Holiday Brain Teaser | PuzzlingInPython 7:48 pm

on17 October 2021 Permalink |[…] From The Sunday Times, 4th August 1957 [link] […]

LikeLike

## GeoffR 10:38 pm

on17 October 2021 Permalink |A Python solution ran in 258 msec.

LikeLike

## Frits 12:33 am

on18 October 2021 Permalink |LikeLike

## GeoffR 9:17 am

on18 October 2021 Permalink |@Frits:

Neat solution.

The combined use of

`first()`

in an iterator and`inf`

from the enigma.py library solves the problem I had in fixing the upper bound in a search for value B4.LikeLike

## Frits 9:57 am

on18 October 2021 Permalink |@GeoffR: the other way of achieving it is to break out of a while True loop for the first correct B4.

Also possible is using a wheel [2, 40, 152, 190] so that (i * i – 1) always is a multiple of 190.

LikeLike