Wednesday, June 21, 2017

mathematics - Crack the Code #1


You are a bank robber, and you come across a safe. It has a combination lock of 4 digits. Careful research (and stealing papers at the bank) has given you multiple clues as to the code - just barely enough to figure it out.



Digits are referred to as A-B-C-D in the clues. "A + B" is the sum of the first and second digit. All math follows the standard order of operations


Clues



  • The sum of the digits is greater than (A * B) - (C * D).

  • The product of the digits plus their sum is divisible by A and C only.

  • The number is prime

  • The first digit is greater than 6


What four digit number matches these criteria? Also, if you want, post your methodology for finding the correct answer, as this will help me in the future.


Note: I am pretty sure that only one number matches all these clues. However, I may have miscalculated. Please correct me in the comments.




Answer



edited to match intended question:


given that the number is prime, the only potentially valid combination is 8017.


8017:



  • 8+0+1+7 = 16, 8*0 - 1*7 = -7, 16 > -7

  • 8*0*1*7 + 8+0+1+7 = 16, divisible by 8 and 1, but not 7. 0 is undefined.

  • 8017 is prime.

  • 8 > 6.



This depends on the assumption that 0 does not divide 16 evenly, which depends on your definition. This can go either way - 16/0 is undefined, so you could say that (0 divides 16) is undefined. Or, since there's no m such that m*0 = 16, you could say that (0 divides 16) is false.


Methodology is pretty simple. for all numbers 0000-9999, have a computer check if it matches all conditions.


No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...