Maths Puzzle

Author
Discussion

Alex

Original Poster:

9,975 posts

285 months

Tuesday 22nd February 2011
quotequote all
This was originally in Acorn User magazine many years ago.

Find a 9-digit integer that is exactly divisible by 9.
Now remove the 9th digit to leave an 8-digit integer that is exactly divisible by 8.
Now remove the 8th digit to leave an 7-digit integer that is exactly divisible by 7.
And so on, down to a 1-digit integer that is obviously divisible by 1.

What is the 9-digit number? Is there more than one answer?

Alex

Original Poster:

9,975 posts

285 months

Tuesday 22nd February 2011
quotequote all
Damn. Forgot to mention, the digits from 1 to 9 can only appear once each in the number.

Alex

Original Poster:

9,975 posts

285 months

Tuesday 22nd February 2011
quotequote all
zippy3x said:
Tease....

Ok - with the new criteria it's down to 121

However i will pre-empt your next post and tell you that when the digits 0 to 9 can only appear one it goes down to 4

381654720
381654729
783204165
801654723
381654729 was the answer I was looking for, and is the only solution without using zero.

I wrote a BASIC program to solve it on my mate's Dragon 32. I recall it ran for around 30 minutes before finding the solution.

Alex

Original Poster:

9,975 posts

285 months

Tuesday 22nd February 2011
quotequote all
OK, we know the answer. Let's change this to a coding challenge!

I propose the following categories:

  • Most elegant
  • Shortest
  • Fastest
  • Daftest
You can use any language. I'll have a go myself.

No doubt some LISP expert will come along with a single line solution...

Alex

Original Poster:

9,975 posts

285 months

Tuesday 22nd February 2011
quotequote all
Worth a special prize, I think. Smartiest Arse, perhaps? wink

Actually, there is an elegant way to work out the number on paper, without any coding.

Alex

Original Poster:

9,975 posts

285 months

Wednesday 23rd February 2011
quotequote all
That's very good.