Skip to main content
Home
plus.maths.org

Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Main navigation

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • For

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

      Popular topics and tags

      Shapes

      • Geometry
      • Vectors and matrices
      • Topology
      • Networks and graph theory
      • Fractals

      Numbers

      • Number theory
      • Arithmetic
      • Prime numbers
      • Fermat's last theorem
      • Cryptography

      Computing and information

      • Quantum computing
      • Complexity
      • Information theory
      • Artificial intelligence and machine learning
      • Algorithm

      Data and probability

      • Statistics
      • Probability and uncertainty
      • Randomness

      Abstract structures

      • Symmetry
      • Algebra and group theory
      • Vectors and matrices

      Physics

      • Fluid dynamics
      • Quantum physics
      • General relativity, gravity and black holes
      • Entropy and thermodynamics
      • String theory and quantum gravity

      Arts, humanities and sport

      • History and philosophy of mathematics
      • Art and Music
      • Language
      • Sport

      Logic, proof and strategy

      • Logic
      • Proof
      • Game theory

      Calculus and analysis

      • Differential equations
      • Calculus

      Towards applications

      • Mathematical modelling
      • Dynamical systems and Chaos

      Applications

      • Medicine and health
      • Epidemiology
      • Biology
      • Economics and finance
      • Engineering and architecture
      • Weather forecasting
      • Climate change

      Understanding of mathematics

      • Public understanding of mathematics
      • Education

      Get your maths quickly

      • Maths in a minute

      Main menu

    • Home
    • Articles
    • Collections
    • Podcasts
    • Maths in a minute
    • Puzzles
    • Videos
    • Topics and tags
    • Audiences

      • cat icon
        Curiosity
      • newspaper icon
        Media
      • graduation icon
        Education
      • briefcase icon
        Policy

      Secondary menu

    • My list
    • About Plus
    • Sponsors
    • Subscribe
    • Contact Us
    • Log in
    • Blue number 9

      Finding the nine...

      9 December, 2010

      This challenging puzzle comes from our good friend James Grime — thanks James!

      Find a nine digit numbers, using the numbers 1 to 9, and using each number once without repeats, such that; the first digit is a number divisible by 1. The first two digits form a number divisible by 2; the first three digits form a number divisible by 3 and so on until we get a nine digit number divisible by 9.

      You might try, for example, the number 923,156,784. But this number doesn't work — the first three digit number, 923, is not divisible by 3. Can you find a nine digit number that works?

      Hint: you don't need a computer to find it. Try looking at your clock instead....


      James Grime is a lecturer and public speaker on mathematics, and can be mostly found touring the country on behalf of the Millennium Mathematics Project carting his trusty Enigma Machine. If you'd like James and the machine to visit your school, visit the Enigma website.

      You can also read more from James in his article, Curious Dice.

      Solution link
      Finding the nine - solution
      • Log in or register to post comments

      Anonymous

      4 January 2011

      Permalink
      Comment

      381654729 is not unique.
      963258147 also works.

      peterh@nipltd.com

      • Log in or register to post comments

      Anonymous

      5 January 2011

      In reply to Finding the nine digit number by Anonymous

      Permalink
      Comment

      Sorry 963258147 fails on division by 8

      Can somebody explain the reference to looking at the clock

      Stuart Barker dandsb@ntlworld.com

      • Log in or register to post comments

      Anonymous

      11 April 2011

      In reply to Finding the nine digit number by Anonymous

      Permalink
      Comment

      I think "looking at the clock" is meant to suggest using modular arithmetic. I have heard modular arithmetic explained that way before (i.e. for an analog clock, the hour is incremented modulo 12).

      btw, I think the answer is unique.

      • Log in or register to post comments

      Anonymous

      3 May 2011

      In reply to Finding the nine digit number by Anonymous

      Permalink
      Comment

      number is 987654321

      • Log in or register to post comments

      Anonymous

      5 May 2011

      In reply to solution by Anonymous

      Permalink
      Comment

      No it's not. It fails at 7th digit, 9876543 is not divisible by 7.

      • Log in or register to post comments

      Anonymous

      2 December 2011

      In reply to No it's not. It fails at 7th by Anonymous

      Permalink
      Comment

      Sure it is.
      9876543/7 = 1410934.714285714....

      Did you mean "evenly divisible"?

      • Log in or register to post comments

      Anonymous

      12 January 2012

      In reply to Smart Alec by Anonymous

      Permalink
      Comment

      you have missed the 'spirit' of the question - as well you know!

      • Log in or register to post comments

      Anonymous

      2 May 2014

      In reply to pedantic by Anonymous

      Permalink
      Comment

      The answer will always be |o| or in simpler terms 0.0 :)
      I find it weird it's not possible on a calculator
      1=0 so does 0

      • Log in or register to post comments

      Sourav Jaiswal

      28 May 2019

      In reply to pedantic by Anonymous

      Permalink
      Comment

      No, Zero is not a 9 digit number, until you write zero like 000000000

      • Log in or register to post comments

      Anonymous

      27 July 2012

      In reply to Smart Alec by Anonymous

      Permalink
      Comment

      In that case, every number is divisible by every number.. hence, all 9 digit numbers would be solutions.. :- ) But, you seem to missed the point.

      Anil Sharma

      • Log in or register to post comments

      Anonymous

      29 September 2011

      In reply to Finding the nine digit number by Anonymous

      Permalink
      Comment

      381654729 WORKS!!!

      • Log in or register to post comments

      Maria Rios

      16 May 2019

      In reply to Finding the nine digit number by Anonymous

      Permalink
      Comment

      9 plus 6 equals 15 which is NOT divisible by 2!

      • Log in or register to post comments

      Anonymous

      3 May 2011

      Permalink
      Comment

      number=987654321

      • Log in or register to post comments

      Anonymous

      31 October 2012

      In reply to sol by Anonymous

      Permalink
      Comment

      This doesnt work on division by 7 : 9876543/7 = 1410934.714... hence not evenly divisible, the only solution is 381654729

      • Log in or register to post comments

      Anonymous

      5 May 2011

      Permalink
      Comment

      987654321

      • Log in or register to post comments

      Anonymous

      12 June 2011

      Permalink
      Comment

      Let the number be abcd5fghi. It's clear that the fifth digit has to be 5. b, d, f and h are elements of {2,4,6,8} and the remaining a, c, g and i are elements of {1,3,7,9}. So there are at most 24 * 24 = 576 possibilities. But we can limit these possibilities drastic. 2c + d has to be divisible by 4, 4d + 20 + 4f by 6 and 2g + h by 4. Now you will find only one possibility: 381654729

      • Log in or register to post comments

      Anonymous

      2 December 2011

      In reply to The nine digit number by Anonymous

      Permalink
      Comment

      Best answer by far.

      • Log in or register to post comments

      Anonymous

      9 February 2019

      In reply to The nine digit number by Anonymous

      Permalink
      Comment

      please explain the 2nd to last line about divisibility

      • Log in or register to post comments

      Anonymous

      26 July 2011

      Permalink
      Comment

      I found at least two numbers 921,252,564 and 987,654,564

      • Log in or register to post comments

      Anonymous

      30 August 2011

      In reply to not unique by Anonymous

      Permalink
      Comment

      I don't think you heard the question correctly. go back and listen taking note about how many times each digit can appear

      • Log in or register to post comments

      someone

      23 April 2018

      In reply to not unique by Anonymous

      Permalink
      Comment

      errrr. I don't think you heard the question right. It said you could only use every digit once...

      • Log in or register to post comments

      minimoley

      20 September 2011

      Permalink
      Comment

      E=5 because multiples of 5 end in 5 or 0
      Alternate digits must be even, so the rest have to be odd.
      Digits C and D have to go "odd,even", and make a number which is a multiple of 4. So D has to be 2 or 6.
      Ditto position H- must be 2 or 6.
      The only even numbers left are 4 and 8, and these must go in B and F.
      Looking at the first three digits, whose digital root must be 3,6 or 9, there are 9 options for filling these given the conditions we've already worked out.
      We tried each of these in turn and worked out the digital root up to F. This also has to be 3,6 or 9 to make it divisible by 6. So you can work out in each case whether D is 2 or 6.
      From this we can see what H is as one of its options has been used.
      Only two digits remain- we test whether either makes a multiple of 7 when put in position G.
      Finding that one of these works, check that the first 8 digits are divisible by 8.
      After this only one answer remains:
      381654729

      (Also, has anyone noticed the patterns this and other suggestions make on the calculator buttons? They are symmetrical or generally interesting.)
      If you followed that, I'm impressed. :)

      • Log in or register to post comments

      tyahner

      7 December 2017

      In reply to my solution by minimoley

      Permalink
      Comment

      How come the digits need to alternate even/odd?

      • Log in or register to post comments

      Catt

      11 September 2018

      In reply to question by tyahner

      Permalink
      Comment

      Because even numbers are evenly divisible only by other even numbers.

      • Log in or register to post comments

      Anonymous

      1 May 2012

      Permalink
      Comment

      381654729

      • Log in or register to post comments

      Anonymous

      17 May 2012

      Permalink
      Comment

      123456789 is also a correct answer .

      • Log in or register to post comments

      Anonymous

      14 July 2012

      In reply to anonymous by Anonymous

      Permalink
      Comment

      Sorry 1234 is not divisible by 4

      • Log in or register to post comments

      Anonymous

      14 July 2012

      Permalink
      Comment

      123456789 is not a correct answer I'm afraid :(

      • Log in or register to post comments

      Anonymous

      19 July 2012

      Permalink
      Comment

      986754321

      • Log in or register to post comments

      Anonymous

      14 December 2012

      In reply to 986754321 by Anonymous

      Permalink
      Comment

      Sorry not correct because 986 is not divisible by 3

      • Log in or register to post comments

      Anonymous

      30 August 2012

      Permalink
      Comment

      here i have one possible solution.
      123654321

      • Log in or register to post comments

      Anonymous

      14 December 2012

      In reply to answer by Anonymous

      Permalink
      Comment

      Sorry this is not correct because all the number 1..9 should occur once

      • Log in or register to post comments

      Anonymous

      22 December 2012

      Permalink
      Comment

      I found this in 15 seconds, mentally. 14 here.
      243,157,896.

      • Log in or register to post comments

      Anonymous

      7 April 2013

      In reply to Solution by Anonymous

      Permalink
      Comment

      2431 is not divisible by 4.

      • Log in or register to post comments

      Anonymous

      27 April 2013

      Permalink
      Comment

      If we generalize this problem to other bases, these are what you get.

      For Base 2 (binary), there are no solutions.

      For Base 4 (quaternary), there are two solutions: 123 and 321.

      For Base 6 (senary), there are two solutions: 14325 and 54321.

      For Base 8 (octal), there are six solutions: 1274563, 3254167, 5234761, 5614723, 5674321, and 7234561.

      I have yet to do the odd bases or the bases higher than 10 (decimal).

      • Log in or register to post comments

      Anonymous

      19 September 2014

      In reply to Generalizing to other bases by Anonymous

      Permalink
      Comment

      For Base 2 an admittedly somewhat trivial solution becomes apparent if you append a final zero as you can in the case of any base b so that you get a final number divisible by b as well. So you can divide 1 by 1 in Base 2, and then 10 by 2 (ie divide 10 by 10 base 2) just as you can divide 3816547290 by 10 Base 10.

      By my reckoning three of the solutions you give for octals are in error: 127456 and 561472 aren't divisible by 6, and in the last, 723 isn't divisible by 3.

      But hey, the other three are three more than what I found!

      Have you got anywhere with solutions for other bases? One clue is that for an even base b the middle number must be b/2, so 6 for base 12 as 5 for 10, 4 for 8 etc.

      • Log in or register to post comments

      Anonymous

      23 September 2014

      In reply to Generalizing to other bases by Anonymous

      Permalink
      Comment

      I'm embarrassed to report that your solutions for octals are correct after all. (Editor: Please remove that bit of my reply if you can!!)

      • Log in or register to post comments

      Anonymous

      23 September 2014

      In reply to Generalizing to other bases by Anonymous

      Permalink
      Comment

      It's me again - I said that my post in reply to "Generalizing to other bases" erroneously attributed an error, but I just checked again and find I was in fact right after all, the contributor had indeed made a mistake in some of his solutions, so best let my first reply stand. But please do some checking yourselves to settle the matter! (Remembering of course to use an octal calculator which displays to the right of the octal point).

      • Log in or register to post comments

      Anonymous

      10 March 2015

      Permalink
      Comment

      I've found a number which is satisfies conditions similar to those for 381654729 but with a more orderly progression of digits:

      111111222222333333444444555555666666777777888888999999

      111111 is divisible by 1, and 111111222222 by 2, 111111222222333333 by 3, 111111222222333333444444 by 4 all the way up to that number above, which is divisible by 9.

      Moreover the divisors can also consist of six digits: 111111222222 is divisible by 222222; 111111222222333333 by 333333 and so on.

      So far I've only got this to work with a dividend consisting of each digit repeated six times, and divisors consisting of either one or six repeated digits.

      (PS I sent this direct to James Grime as well, who said it was nice. The highest compliment)

      Chris G

      • Log in or register to post comments

      akash agrawal

      2 February 2017

      In reply to Finding the 999999 by Anonymous

      Permalink
      Comment

      How can 1234 is divisible by 4

      And if u r trying to use 1111222233334444 then
      We can use every digit once only

      • Log in or register to post comments

      Anonymous

      27 July 2015

      Permalink
      Comment

      B=8, D=6, E=5, F=4, H=2

      1. A and C= 1 and 3; G=7; I=9
      2. A and C= 1 and 9; G and I = 3 and 7
      3. A and C= 7 and 9; G=3; I=1

      183654729
      381654729
      189654327
      189654723
      981654327
      981654723
      789654321
      987654321

      These 8 numbers satisfy all the conditions except for divisibility by 7.
      Is there a way to get the correct answer without checking each number individually?

      • Log in or register to post comments

      Anonymous

      29 July 2015

      In reply to B=8, D=6, E=5, F=4, H=2 1. A by Anonymous

      Permalink
      Comment

      Yes, it's very interesting how 7 is so often the one problem non-divisor when all the others fit neatly in. I also encountered that in the course of building up to that remarkable number in my previous post. (I'm not bragging, the number's remarkable, not me). For example

      111222333444555666777888999

      works for each digit except 7 or 777. Damn! It's only when I got up to groups of six repdigits that 7 finally toed the line along with all the others and divided in where it should. Yet golly, when it does divide it does so in spades.

      Look at that number again:

      111111222222333333444444555555666666777777888888999999

      Each individual repdigit group of six is divisible by 7. Not only that, each successive group of groups is as well. For example 111111222222 is, and 111111222222333333, and so on.

      I'm not going any further for now. After six digits I shall rest with the seventh.

      Chris G

      • Log in or register to post comments

      Anonymous

      24 November 2015

      In reply to B=8, D=6, E=5, F=4, H=2 1. A by Anonymous

      Permalink
      Comment

      is there any number which satisfies every condition???

      • Log in or register to post comments

      Anonymous

      11 December 2015

      Permalink
      Comment

      There are three sequences that aren't divisible by their last digit: 1234 isn't divisible by 4, 1234567 by 7, or 12345678 by 8. Either replace the last digit in each case with 2, or add 2, and the situation is rectified.

      What about the reverse of the 1-9 sequence? 987654321 is divisible by 9, 98765432 by 8, 987654 by 6, 98765 by 5, 9876 by 4, 987 by 3, 98 by 2, 9 by 1. This time only 7 is the snag (as usual) since 9876543 isn't divisible by 7, so we have to add 2 again.

      What about dividing the reverse by the last digit? 9 is divisible by 9, 98 isn't divisible by 8, ah but 987 is actually divisible by 7, and the others going downwards are also divisible by their last digit except 987654 isn't divisible by 4. So this time subtract 2 from the odd ones out.

      Chris G

      • Log in or register to post comments

      Anonymous

      30 August 2016

      Permalink
      Comment

      now try it in hex ;)

      • Log in or register to post comments

      Surendranath

      28 July 2017

      Permalink
      Comment

      381654729

      This number by dividing as mentioned in question without repetition works...plzz check

      • Log in or register to post comments

      Oviyan patnaik

      15 August 2021

      In reply to Regarding the nine digit number by Surendranath

      Permalink
      Comment

      My no. is 126357984

      • Log in or register to post comments

      Shekhar Kumar

      14 June 2022

      In reply to Pls help me to find the Ans. by Oviyan patnaik

      Permalink
      Comment

      1263 is not divisible by 4.

      • Log in or register to post comments
      University of Cambridge logo

      Plus Magazine is part of the family of activities in the Millennium Mathematics Project.
      Copyright © 1997 - 2025. University of Cambridge. All rights reserved.

      Terms