Susan couldn't quite remember her bank PIN code.
She knew:
-
It had 4 or 5 digits.
-
It used 4 or 5 different digits.
-
The first digit is 4 or 5.
-
The second digit is 4 or 5 and none of the other digits is smaller.
-
The number is 4 or 5 times a prime number.
-
If you reverse the order of the digits, the resulting number has 4 or 5 prime factors, all different.
-
In 4 or 5 of these facts, the "4" is the correct number.
What is Susan's PIN code?
The given conditions require that the solution be of one of the following forms:
44 44**{5,6,8}
45 45*{6,8) 45**{4,5,6,8}
54 54*{6,8} 54**{4,5,6,8}
55 55**{4,6,8}
The candidates with 4 digits can readily be eliminated by manual calculation. As to those with 5 digits, it may be simplest to generate a list of primes between 8800 and 14000 multiplied by 4 and 5 as necessary: Prime[Range[1336, 1653]]*4 and Prime[Range[1096, 1360]]*5. Although about 500 in all, these produce by inspection a mere 30 or so holdouts whose inverses need to be factorised. Of these, only 2 have 4 factors: 56854 and 67445.The former fails the '4 out of 5 facts' test. So the PIN number is 54476.
In future, Susan should employ the simple mnemonic that her pin number is (2*3)^2+(2*5)^2+(2*(7-1))^2+(11^2+19)^2+(13^2+17)^2, whereby she need never again forget her PIN. Alternatively she could use some obscure number that no-one else would ever guess, such as 78557.
Edited on November 17, 2010, 11:59 am
|
Posted by broll
on 2010-11-17 11:34:53 |