28

My car has a four digit number with no leading zeros, and the following properties:

Its last digit is double the first digit

its middle two digits are the same

its last two digits are double the first two digits

What is my car's number?

justhalf
  • 6,014
  • 2
  • 31
  • 49
Deepu Sasidharan
  • 1,318
  • 2
  • 12
  • 22
  • 1
    It would be clearer if it didn't use "..two digits" two different ways... – DJohnM Jan 22 '16 at 05:21
  • 2
    I interpreted the "last two digits are double the first two digits" as "the sum of last digits is twice the sum of first two digits", rather than "the number composed of first two digits is double the number composed by the last two digits". It seems like I'm not the only one to do so, so you should probably clarify that in the question. – Alexander Revo Jan 22 '16 at 10:27
  • 5
    What's a "car number"? Why does your car have a number? – user2357112 Jan 22 '16 at 20:51
  • I interpreted that as "the third digit is double the first digit, and the fourth digit is double the second digit". In which case there are no solutions! – user253751 Jan 23 '16 at 07:16
  • @user2357112 in some languages, the alphanumeric string printed on a license plate of a vehicle is literally called a "car number". It usually includes the country and city prefix, but sometimes people use the word for the unique part on the end only. – rumtscho Jan 24 '16 at 11:40
  • 1
    I don't know what a "car number" is, and in any case, it's not clear how this affects the puzzle. Why not just say, "a number"? – Jay Jan 25 '16 at 14:56
  • Does "its last two digits are double the first two digits" mean that the concatenation of the first two digits and the concatenation of the last two digits have a ratio of two, and not the sum? – Portali5t Jan 27 '16 at 00:12

11 Answers11

83

Last digit is the double of first digit;

1..2
2..4
3..6
4..8

Middle two digits are same. It has to be a number when multiplied by 2 has the last digit in it;

1662
2774
3886
4998

Last two digits are the double of first two digits The only correct possible answer

4998

ACB
  • 6,561
  • 3
  • 19
  • 49
sjaak bakker
  • 1,129
  • 1
  • 7
  • 21
  • 1
    i guess i took too long to write the explanation down, but i just didn't want to post it without explanation – sjaak bakker Jan 21 '16 at 10:41
  • 3
    Welcome to Puzzling.SE! This is a great first answer c: – Deusovi Jan 21 '16 at 18:17
  • 2
    I appreciate the fact that this answers is based on a plain reasoning, instead of the selected answers which uses a script (I know, you must use your brain to create a scripts too... but this answer is IMHO far more creative, and for this reason valuable of being selected as best answer...) – Hunter Jan 22 '16 at 10:01
  • 1
    I agree this is a very good answer, I particulary liked the second reasoning! ... +1 from me – Thrax Jan 22 '16 at 10:59
  • this should be the accepted answer – srk_cb Jan 24 '16 at 19:11
  • 1
    Based on you current explanation you missed other four cases after second reasoning where there is no carry when double the middle digits (i.e., 1112, 2224, 3336, 4448). But those will be removed by the third reasoning anyway. – justhalf Jan 25 '16 at 04:42
33

A deductive approach:

The number has form abb(2a) for digits a and b. Since the last two digits are double the first two, 10b + 2a = 2(10a + b). So 8b = 18a and 4b = 9a. Therefore b = 9, a = 4, and the solution is 4998.

Paul Sinclair
  • 1,280
  • 7
  • 15
  • The "therefore" follows because b = 18a/8 is an integer iff a is of the form LCM[18,8]*x/8 for all natural x. Of all these options only the first one fulfills the other requirements (well if we assume the natural numbers start at 1). Just to make that part a bit more thorough - good answer though. (I hope that math doesn't count as a spoiler, I removed anything that'd give away the answer for anyone who can't do the least common multiple in their head). – Voo Jan 22 '16 at 18:12
  • 2
    Realistically, anyone wanting to avoid spoilers shouldn't even be reading comments. A simpler explanation: $a \ne 0$ since leading 0s have been disallowed from the solution. $4b = 9a$ requires $b \ne 0$ either. Now $4$ and $9$ are relatively prime. So, since $9$ divides $4b$, it must divide $b$. The only single digit numbers divisible by $9$ are $0$ and $9$. Thus $b = 9$ and $a = 4\times9 / 9 = 4$. – Paul Sinclair Jan 22 '16 at 18:19
16

Answer should be

4998

Script I used :

# RUBY
for i in 0..9999

  j = i.to_s.rjust(4, "0") # 0 padding
  a = j[0]
  b = j[1]
  c = j[2]
  d = j[3]

  if (b != c) then next end # Rule2
  if d.to_i != (2 * a.to_i) then  next end #Rule1
  if 2 * (a.to_s + b.to_s).to_i != (c.to_s + d.to_s).to_i then next end #Rule3

  puts j

  next

end
Thrax
  • 1,108
  • 7
  • 14
12

I think it's

4 9 9 8

Good math problem! ;)

Done in the old way, not programming took place!

From the clues we have:
a b c d
d = 2*a
b = c
10*c + d = 2*(10*a + b)

Doing some substitution we achieve:

10*b + 2*a = 2*(10*a + b)
8*b = 18*a
4*b = 9*a

So

a has to be a 4
b has to be a 9
cd has to be 49*2 = 98

Lupuz
  • 129
  • 6
  • Yes correct ... – Deepu Sasidharan Jan 21 '16 at 10:26
  • 2
    Could you share your old way method? That is most of the fun of seeing the solutions here. – user1717828 Jan 21 '16 at 17:49
  • Yes, that's the way I did it. You might want to clarify that while 4b=9a has an infinite number of solutions if a and b are rational (a=1, b=9/4; a=16, b=36; etc), here we are limited to integers between 1 and 9, and so the only solution is a=4, b=9. – Jay Jan 25 '16 at 15:02
4

well...

0 0 0 0

Seems to fit :)

RiddlerNewComer
  • 1,808
  • 10
  • 20
3

If a is the first digit b is the second and third and d is the last, then

20*a + 2*b = 10*b + d

because its last two digits are double the first two digits. Or, simplifying

20*a = 8*b + d

Because Its last digit is double the first digit, we can rewrite this as

20*a = 8*b + 2*a

Which amounts to

9*a = 4*b

Since the 0 solution is forbidden, and both a and b are naturals less than 10, evidently the answer is

4 9 9 8, where a = 4, b = 9 and d = a*2 = 8

Andrew Savinykh
  • 597
  • 4
  • 11
1

x 0 0 2x where 0<x<4.

  • Its last digit is double the first digit [x and 2x, check]

  • its middle two digits are the same [0&0, check]

  • its last two digits are double the first two digits [x+0 and 0+2x, check]

  • 1
    As for your answer: There already was a different and accepted answer. While the mistake probably comes from poor wording in the question, the OP was looking for a number abcd were 'cd' = 2x 'ab'. You considered the sum of 'a' and 'b', and compared to 'c' + 'd'. – Tim Couwelier Jan 22 '16 at 09:52
1

For the last digit to be double the first digit but also the last two digits being double the first two digits then the first two digits must differ by 5, giving (a)(a+5)(a+5)(2a). The restriction on the third digit then requires a+5 = 2a+1 (from the carry from 2(a+5)) which simplifies to a=4.

Neil
  • 423
  • 4
  • 7
  • 1
    " then the first two digits must differ by 5" - while true, this is not readily apparent, and deserves some explanation. – Paul Sinclair Jan 22 '16 at 16:03
  • @PaulSinclair Doubling the digits must result in a difference that is a multiple of 10. Because of the limited range of a digit, this can only be 0 or 10. If the difference is zero, then the first two digits are the same, and by extension all four digits are the same, hence zero, hence excluded. – Neil Jan 22 '16 at 17:20
  • "Doubling the digits must result in a difference that is a multiple of 10". DIfference between what? And why must it be 10? – Paul Sinclair Jan 22 '16 at 17:45
  • Difference between the first two digits as you originally asked, and because we're working in base 10. – Neil Jan 22 '16 at 19:38
  • That makes no sense at all. The difference between the first two digits is at most 9, simply because they are both digits, so it cannot be a multiple of 10. And the question is why "doubling the digits" required this difference to be a multiple of 10. – Paul Sinclair Jan 22 '16 at 19:57
  • I never said that the difference was a multiple of 10 before you double it. After you double the digits, the different must be 10 because the resulting numbers must have the same last digit, which is that of the original number, and it can't be because the digits are the same, as I already said. – Neil Jan 22 '16 at 21:04
  • You said "Doubling the digits must result in a difference that is a multiple of 10". I asked "Difference between what?", Very clearly, i was asking about the "difference that is a multiple of 10". You replied "Difference between the first two digits". So yes, you did say that the difference between the first two digits was a multiple of 10. It may not be what you intended, but that is a mistake of yours, not mine. – Paul Sinclair Jan 22 '16 at 21:26
  • And as it turns out, your entire analysis was based on a mistake. The answer is $4998$. You will note that $98-49 = 49$, which is not a multiple of $10$. You missed that the 10s digit of the first pair of digits is doubled to get the 1s digit of the 2nd pair, so the difference between twice the first pair and the second pair is not a multiple of $10$. – Paul Sinclair Jan 22 '16 at 21:29
  • You asked about doubling the difference, and which digits, so I thought I was confirming that it was the first two digits. And I know what the answer is, as I already said that a=4. And I never said anything about the difference between pairs of digits; you just made that up. – Neil Jan 23 '16 at 00:01
  • Since it is all there in the comments, anyone reading it can tell what you really said, so I don't know how you think denying it is going to be believable. As for getting a = 4, a being 0 is disallowed, and 2a being a digit by itself restricts the choices to 1, 2, 3, or ,4. Therefore, no matter how badly you mess up the rest of the analysis, you still have a 25% chance of getting the right answer, so the fact that you arrived at a =4 by itself provides little evidence that your method was correct. – Paul Sinclair Jan 23 '16 at 19:20
  • I'm so surprised that you weren't able to simplify a+5=2a+1 to a=4 that at this point I can only imagine that you're trolling me. – Neil Jan 23 '16 at 20:08
  • On a brighter note, if you're giving me a 25% chance, that must mean that you agree with the rest of me method. – Neil Jan 23 '16 at 20:41
1

Without looking at any answers, it's:

4998.

Because:

Form the first two clues it's of the form a b b (2a).
So from the last: 20a + 2b = 10b + 2a.
Or: 9a = 4b.
The only single nonzero digits this works for is a = 4 and b = 9

Paul Evans
  • 9,431
  • 2
  • 25
  • 49
1

A little bit different coding solution: This can be done by creating the cartesian product of four instances of the set of numbers 0-9. This results in a list of our products, each of length 4 (ten thousand such lists, or 104); first is (0, 0, 0, 0), last is (9, 9, 9, 9). Then we filter that list based on the given constraints

In scala:

val toTen = Range.inclusive(0, 9)

val candidates = for { x <- toTen; y <- toTen;
              z <- toTen; a <- toTen } yield (x, y, z, a)

val result = candidates.drop(1)   // exclude 0000
   .filter(x =>
     (x._4 == 2*x._1) && (x._2 == x._3) &&
     (x._3*10 + x._4) == 2*(x._1 * 10 + x._2))
   .head

res1: (Int, Int, Int, Int) = (4,9,9,8)

wovenhead
  • 11
  • 2
  • Welcome to Puzzling.SE! Typically we try not to solve "small" puzzles with code, but this is a perfectly acceptable solution. Hope to see you around here more! c: – Deusovi Jan 24 '16 at 02:13
0

Wolfram Mathematica solution:

Wolfram Mathematica solution

The answer should be:

4998

Sauron
  • 171
  • 3