### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,972 hits

Advertisements

Programming Enigma Puzzles

1 December 2011

Posted by on **From New Scientist #1143, 22nd February 1979** [link]

“If they hadn’t invented the Closed University,” said Radiotimes of Ilea, “I shouldn’t have learned about the serious function. Every birthday now I work out how serious my new ages is. For instance, I am 27 today, and I calculate the seriousness of 27 as 4; or, as we say at the CU, S(27) = 4. That is because, as you see from the blackboard, there are 4 ways in which you can compose an arithmetical progression of one or more positive integers, in which each term is 1 greater than the previous one, with the sum of the terms totalling 27”.

“I see,” I said.

“Just to be sure you do see,” said Radiotimes, “tell me:

(a) if I live to be 100, what is/are the most serious birthday(s) I shall have had?

(b) How much over 100 should I have to live to reach a more serious birthday than that?”

This is the first Enigma puzzle ever published in **New Scientist**!

A £5 prize was offered for the solution (about 14.3 times the 35p cover price of the magazine).

An incomplete solution was published in **New Scientist #1144**, but that was followed up with a clarification in **New Scientist #1145**.

[enigma1]

Advertisements

%d bloggers like this:

This Python program finds the solution in 30ms:

Solution:(a) The most serious birthdays are: 45, 63, 75, 90 and 99. All have seriousness of 6. (b) Birthday 105 exceeds these with seriousness 8.I think I’m right in saying that a number has seriousness 1 if and only if it’s a power of 2 (including 2^0 = 1).

The smallest numbers with these seriousnesses appear to be:

S(1) = 1, S(3) = 2, S(9) = 3, S(15) = 4, S(81) = 5, S(45) = 6, S(729) = 7, S(105) = 8, S(225) = 9, S(405) = 10, S(315) = 12, S(3645) = 14, S(2025) = 15, S(945) = 16.

For S = 11 or 13 one would have to go a lot higher.

Can’t see much of a pattern!

The sequence appears in OEIS as A001227 [ https://oeis.org/A001227 ], where it is characterised as “a(n) = the number of odd divisors of n”.

So we could shorten the computation of

S(n)to:So we can find lowest values of

nforS(n)by multiplying together odd numbers:OEIS sequence A038547 [ https://oeis.org/A038547 ] lists the smallest number with exactly

nodd divisors. For primep,n = 3^(p − 1)givesS(n) = p.To mark the occasion of publishing 1000 Enigmas with Enigma 364, I thought I would try the first Enigma, published in 1979 .Keep up the good work , Jim

Here is my programme for Enigma 1

The output of this programme confirms the previously results and shows the ‘seriousness of all ages between 1 and 100:

Part (a) – serious numbers in range 1 – 100

——————————————-

Seriousness [ Ages ] No of Values

1 [1, 2, 4, 8, 16, 32, 64] 7

2 [3, 5, 6, 7, 10, 11, 12, 13, 14, 17, 19, 20, 22, 23, 24, 26, 28, 29, 31, 34, 37, 38, 40, 41, 43, 44, 46, 47, 48, 52, 53, 56, 58, 59, 61, 62, 67, 68, 71, 73, 74, 76, 79, 80, 82, 83, 86, 88, 89, 92, 94, 96, 97] 53

3 [9, 18, 25, 36, 49, 50, 72, 98, 100] 9

4 [15, 21, 27, 30, 33, 35, 39, 42, 51, 54, 55, 57, 60, 65, 66, 69, 70, 77, 78, 84, 85, 87, 91, 93, 95] 25

5 [81] 1

6 [45, 63, 75, 90, 99] 5

Max seriousness of ages 1 – 100 = 6 ( for 45, 63, 75, 90, 99 )

Part (b) – next highest serious number > 6

———————————————–

Seriousness [ Ages ] No of Values

2 [101, 103, 104, 106, 107, 109, 112, 113, 116, 118] 10

3 [100] 1

4 [102, 108, 110, 111, 114, 115, 119, 120] 8

6 [117] 1

8 [105] 1

Max seriousness – numbers 101 to 120 = 8 (for 105)

I amended my programme to find all the components of a serious number

Hugh commented on powers of 2 having a seriousness of 1.

As powers of 2 can be expressed as 1 * 2 ^ n, they will only have 1 odd number as a divisor, so would have a seriousness of 1, according to Jim’s formula.

I then started looking into numbers with repeated digits with some interesting results.

The programme below looks at the numbers of odd and even divisors of the following numbers with repeated digits :(111111,222222,333333,444444,555555,666666,777777,888888,999999)

The first part of the programme confirms these are all serious numbers, both in terms of Jims’ function and my solver.

The second part of the programme then finds all the odd and even divisors of these numbers, the odd divisors being the ‘serious’ numbers

Where there are total odd or even divisors > 0, these divisors are all multiples of 16 – I guess there must be a reason