cover

On Friday I posted this puzzle.

I am thinking of a 5-digit number.   If you put ‘1’ at the beginning of the number you get a number that is three times smaller than if you put ‘1’ at the end of the number.  What number am I thinking of?

If you have not tried to solve it, have a go now.  For everyone else the answer is after the break.

The answer is ‘42857’ (142857 is three times smaller than 428571) – did you solve it and, if so, how?

I have produced an ebook containing 101 of the previous Friday Puzzles! It is called PUZZLED and is available for the Kindle (UK here and USA here) and on the iBookstore (UK here in the USA here). You can try 101 of the puzzles for free here.

41 comments

    1. Much better than my way which was to resolve each digit step by step. Substituting variables a-e for each of the five digits we get

      3 x 1abcde = abcde1

      so 3 x e must result in a number ending in 1. Therefore e must be 7 (the only possible single digit solution). 3 x 7 = 21, giving 2 to carry. This gives

      3 x 1abcd7 = abcd71

      Therefore (3 x d) must result in a number ending in 5 (as we have 2 to carry). Therefore d must be 5 giving

      3 x 1abc57 = abc571

      Continue in this vein and you get

      3 x 1ab857 = ab8571
      3 x 1a2857 = a28571
      3 x 142857 = 428571

      That makes the five digit number 42857

    2. @steve Jones
      An elegant solution, though it relies on the 3 times table having unique ending integers, if the problem would have been times 5, this technique would struggle.

    3. @Mike of course it would struggle with a 5 x problem, but of course all systems would as there would be no solution as all multiples of that 5 in zero or 5. If you replaced the “1” prefix/suffix with 5, there would still be no solution as 5 x 5 leads to a carry in the most significant digit.

      Where the prefix/suffix is a 1, then (leaving out the trivial multiplier or 1), it seems to me that only multiplies of 3 or 7 might provide any solutions at all to similar problems as, of the single digit numbers, only those and 9 are divisible by a number ending in 1. In the latter case, it’s obvious there will always be a carry in the most significant place. 7 also shares with 3 the property that it can generate each to the single digits in the least significant place by multiplication by one, and only one, of the single digit integers.

      I might play around and see if there is a solution involving a multiplier of 7 (for whatever length of original number). There is an interesting point that the solution of 3 * (100000 + x) = 10 * x + 1 involves a division by 7. (x = 99999/7). This might well not be coincidental.

  1. I wrote this in a piece of paper:
    1 _ _ _ _ _
    x 3
    ________
    _ _ _ _ _ 1

    Then it is a matter if trying to fill in the blanks.

    1. That’s how I did it! I thought there must be a cunning way, but I couldn’t figure out what it was so I just repeatedly narrowed it down. I think I should attend a maths class 🙂

  2. I did it that algebra way, but the embarrassing part is that I was too lazy to calculate 299999/7 since I haven’t done long division in maybe 40 years.

  3. I solved this by building the an equation that adds 1 to the start using +100000, and to the end using multiply by 10 and add 1, adding in the 3 times multiplier gave: 3(x+100000)=10x+1
    which rearranges to x = ((3*100000)-1)/(10-3)
    and solves to x= 42857

    You can create a ‘type’ equation of X = ((A*(B*10^C))-B)/(10-A)
    Where A = the multiplier, B = the added digit, and C = the number of digits.

    From this I also found that this problem also has a nice integer solution too:
    I am thinking of a 5-digit number (C=5). If you put ’2′ (B=2)at the beginning of the number you get a number that is three(A=3) times smaller than if you put ’2′ at the end of the number. What number am I thinking of?

    (The answer is different to the first problem, though has an interesting relationship!)

    1. Mike: Thanks. That’s really clever and I might have spent a fortnight on it and still not found the right answer.

      (I hope we get another one like this so I can use the same idea to solve it!)

  4. I realised that the last digit of the answer must be a 7 (and the first would be a 3 or a 4) and then got stuck. So I opened up Excel and in column A put 30007, 30017, 30027, etc then in column B put 3* (100000+ column A), column C was (10*column A + 1) and column D was column C- column B. Filling down a few hundred rows (to row 1286) gave me the answer.
    I then did the ‘jh’ approach on paper above before reading the comments and appreciating the simple algebraic solution – and then some hours later realising that was the approach I’d taken in Excel but made it overly complicated. Slap forehead!

  5. See, and I misread the entire challenge. I thought all 3 numbers consisted of 5 digits, meaning an unknown number with 5 digits, then a 2nd number starting with 1 followed by the 4 last digits of the 1st number, and finally a 3rd number starting with the 4 first digits of the 1st number, but ending in 1. Just to show how different the phrase “to put at the beginning” can be interpreted.

  6. Adding one to the end’s relatively simple: multiply by ten then add one.
    Since we’re dealing with a five digit number, adding one to the start involves adding one hundred thousand (100,000).

    So 10x + 1 = 3 (x + 100,000)

    Expand the brackets:
    10x + 1 = 3x + 300,000

    Get rid of that annoying +1 from each side of the equation:
    10x = 3x + 299,999

    We want the unknown to only be on a single side of the equation, so remove 3x from each side:
    7x = 299,999

    Now divide each side by 7:
    x = 299,999 / 7

    So x = 42,857

  7. I would think that also -42857 is an answer.
    And in this case ( a negative number) the equation would be
    3(-100000+x) = 10x -1

    1. It’s difficult to include the negative side of the equation when the wording is “three times smaller” smaller usually means lower, ie -3 is smaller than -1 as opposed to dealing with absolute magnitude (which, when required, is specifically specified).

  8. I did it iteratively. I didn’t get to the right answer but did know that with a few more iterations I would get there.

    1. Interesting twist, Christian. I don’t think there would be a unique answer in this case, but the challenge could be to find the smallest one.

    2. if you didn’t specify length of the number, you would have many number for answer (or no answer at all). Because for solving this equation 3(A+x)=10x + 1, it is not clear which number must be used for A. I mean, this equation has integer answer for A=10^5, 10^11, 10^15, 10^16,..

    3. shahram,

      Out of curiosity, I wrote a quick Ruby program to do that calculation:

      (1..100).each do |x|
      y = (3* 10**x – 1) / 7.0
      if (y == y.to_i)
      puts “#{x} #{y.to_i}”
      end
      end

      and it shows nothing between powers 11 and 17 (but then hits everything up to 100)

      5 42857
      11 42857142857
      17 42857142857142856
      18 428571428571428544
      19 4285714285714285568

      Can you please show how you got results for powers 15 and 16? Thanks.

  9. Once you realize that putting a 1 in front of the number is the same as adding 100,000 to it, and that putting a 1 on the end of the number is the same as multiplying the number by 10 and adding 1, it becomes a pretty simple algebra equation: 3(x + 100,000) = 10x + 1.

    1. Agreed. Though I’d like to retract my earlier comment regarding expeditions and say that there are a lot of interesting concepts being discussed here relating to this problem.

  10. I solved it relatively quickly but fell into the trap of thinking that mine was the only way.

    My way involved noticing that when multiplying 3 by the numbers zero to 9, the final digits of the results are all different, unlike, say, with 2, where 2 x 2 = 4 but 7 x 2 = 14, which also ends in a 4.

    This means that you can see what you need to multiply 3 by to get the last digit in the larger six-digit number, i.e. the one that ends in 1. It’s 7, because 7 x 3 = 21. So 7 is the last digit of the smaller six-digit number. Now you can subtract 2 from 7 and work out what you need to multiply 3 by to make a number that ends in 5. And you can work your way from right to left in this fashion all the way to the complete answer, doing the reverse process of long multiplication.

    There’s no trial and error because at each stage there’s only one solution, albeit thanks to this peculiar quirk of the number 3. And of course some formulae could be written to express this more succinctly.

    But now that I’ve read the single-formula algebraic solution, I’m annoyed that it’s so much more elegant than mine!

  11. Got it algebraically in about half a minute. However, agonized a bit over the “three times smaller” part. “Three times larger” and “three times the size” are not the same thing. I wasn’t sure how to interpret it but I picked one and it worked.

  12. Took me a moment to figure out that 1 before x is equal to x+100000 and 1 after x is equal to 10x+1. (100000 with five zeroes for numbers of five digits)

    After that, it was just solving for x. The “aha!” part was definitely the first part.

  13. if you will help me i would just let you know that thank you! and sorry if i dont reply anything , thats cause i wont be here or something. THANK YOU!

Leave a reply to Stan Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.