### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,123)
- misc (2)
- project euler (2)
- puzzle (31)
- site news (43)
- tantalizer (31)
- teaser (3)

### Site Stats

- 168,355 hits

Programming Enigma Puzzles

30 November 2011

Posted by on **From New Scientist #2839, 19th November 2011** [link]

By placing the digits 1 to 9 in the boxes of a 3×3 grid, you create three three-figure numbers across the rows and three down the columns. Choose the positions of the digits so that, of those six three-figure numbers, just one is divisible by 2, just one is divisible by 3, just one is divisible by 5, just one is divisible by 6, just one is divisible by 8, just one is divisible by 9, one differs from a perfect square by just 1, and one differs from a perfect cube by just 1.

What are the smallest and biggest of your six three-figure numbers?

[enigma1673]

Advertisements

%d bloggers like this:

A straightforward approach (in Python), yields a solution which runs in 860ms.

This also uses the

is_square()andis_cube()functions from myenigma.pylibrary of useful functions. They check to see if their arguments are a perfect square or perfect cube, respectively.Solution:The smallest number is 143. The biggest number is 937.Dear Jimrandell

Could you do it with pencil and paper. I did.

I too had sketched out a program in Basic but thought that that would take the fun of deduction away!

However, Well done.

What a pity that you published the answer to a PRIZE competition.

At least the poster on the NS Forum just gave the difference which showed they had solved it without giving the ANSWER.

You can solve all Enigma puzzles without computer assistance, however this particular site is about sharing and discussing programmatic solutions (see the “About” page for more details). There are other sites on the web that focus on analytical solutions (and they also publish solutions, if you read the comments). And New Scientist itself warns you that the solution may appear in comments on its own site!

Hi jmrandell Thanks for your kind explan of how it all goes

Could you suggest a blog that focuses on analytical sols

Hope yve had a good holiday and Kind Regards

K WARD

This is a good one: http://www.newenigma.com/enigma/