### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,130 hits

Programming Enigma Puzzles

30 June 2015

Posted by on **From New Scientist #1439, 17th January 1985** [link]

My old schoolteacher used to set us Enigma-type puzzles. For example, he once said the following:

“I have in mind a prime number between 4 and 50. I shall answer some questions about it and leave you to work out what the number is.”

We asked, “Is it one more than a multiple of 3?”

“Is it one, two or three more than a perfect square?” and “Is the sum of its digits odd?”

These he answered yes or no as appropriate and from his three answers we were able to work out the number.

In fact, now that I come to think about it, with all the above information the answer to the second question alone would be enough to enable you to work out the number.

What is it?

[enigma291]

%d bloggers like this:

This program uses the [[

`filter_unique()`

]] function from theenigma.pylibrary to consider the statements for each prime. It runs in 33ms.Solution:The number is 43.