01 Apr '09 13:52

The sum of my 4 digit bank code equals the first two digits. The product equals the last two digits. What is my code?

Solve same problem for a 5 digit code.

Solve same problem for a 5 digit code.

- Joined
- 03 Feb '05
- Moves
- 59458

- Joined
- 11 Nov '05
- Moves
- 43938

01 Apr '09 13:55

You have to hold your bank code as a secret!*Originally posted by camilli***The sum of my 4 digit bank code equals the first two digits. The product equals the last two digits. What is my code?**

Solve same problem for a 5 digit code.

Now everyone knows it and you have to change your code.- Joined
- 02 Aug '04
- Moves
- 8702

Halfway- Joined
- 16 Dec '07
- Moves
- 6190

ALG- Joined
- 02 Aug '04
- Moves
- 8702

Halfway02 Apr '09 10:126 edits

For the 5 digits - label them abcde:*Originally posted by Thomaster***How did you find it?**

4*5*5=100, so even if two of the numbers are 1s, then the others must be lower than 4,5,5. Obviously reducing one of those and increasing the 1s is only making things worse as x^2 is convex. If that is so, then the sum of numbers must be lower than 1+1+4+5+5=16 => a=1.

If a=1, then c+d+e=9 for all possible b!

Moreover, b*c*d*e = 10*d+e <=> b*c = 10/e+1/d. b*c is an integer, so we need to find pairs of (e,d) that result in integers. These are {(1,2),(1,5),(2,4),(3,6)}. Let Sn be the set of solutions for that equation when b=n

S1 = {(6,1,2),(3,1,5),(3,2,4),(2,3,6)}. But c+d+e=9, so we can eliminate (2,3,6). The other 3 are the solutions I've presented.

For S2 to S9 is easy, we only need to divide the c in S1 by b, check if they are integers and if not, discard them. That leaves us with:

S2 = {(3,1,2),(1,3,6)}. None sum up to 9. Eliminate.

S3 = {(2,1,2),(1,2,4),(1,1,5)}. None sum up to 9. Eliminate.

S4 = {}

S5 = {}

S6 = {(1,1,2)} Eliminate.

Rest are empty sets.

Three solutions then:

11612

11315

11324

Edit - Mmm... I assumed digits couldn't be zero. If they can, then the product is zero and d=e=0. We then have a+b+c=10*a+b <=> c=9*a as the only condition => a=1, c=9 and b can be anything. So we also have new possibilities:

(1,b,9,0,0) for b ={0,1,...,9}

(0,b,0,0,0) for b ={0,1,...,9}

Edit - The statement about sum<16 is not correct. However, there are only a few combinations for which sum>=20 and product<100 and it's easy to check they don't work (e.g. 11199), so a=1.- Joined
- 02 Aug '04
- Moves
- 8702

Halfway02 Apr '09 11:25For 6 digits there are no solutions. The same method can be applied, using the 4 valid integer combinations for (e,f) from 10/f + 1/e = some integer. a=1 for the same reasons as before.

Then for b=1, go through the four (e,f) pairs and check possible (c,d) s.t c*d = (10*e+f)/(a*b*c*d) and c+d = (10*a+b)-a+b+e+f. Note that at each point, a,b,e,f are fixed.

For example: a=1,b=1,e=1, f=2 => c+d = 6 and c*d=6 (note 11-(1+1+1+2)=6 and 12/(1*1*1*2)=6). No integers solve those two conditions.

I leave the rest of the proof to you. ðŸ™‚