+0  
 
0
101
5
avatar

When 16 is subtracted from a three-digit number, and the resulting difference is divided by 2, the result is a three-digit number whose digits are those of the original number, but in reverse order.  The sum of the three digits is 20.  Find the original number.

 Dec 15, 2019
 #1
avatar
+3

a=0;b=0;c=0;p=0; cycle:d=a*100+b*10+c;if((d - 16) / 2 ==c*100+b*10 + a and  (a+b+c) == 20, goto loop, goto next); loop:printd," ",;p=p+1; next:c++;if(c<10, goto cycle, 0);c=0;b++;if(b<10, goto cycle, 0);b=0;c=0;a++;if(a<10, goto cycle,0);print"Total = ",p

 

OUTPUT = 974

 Dec 15, 2019
 #2
avatar+515 
+2

974 - 16 = 958

958 / 2 = 479

4 + 7 + 9 = 20

wink

 Dec 15, 2019
 #3
avatar+108626 
+2

When 16 is subtracted from a three-digit number, and the resulting difference is divided by 2, the result is a three-digit number whose digits are those of the original number, but in reverse order.  The sum of the three digits is 20.  Find the original number.

 

\(\frac{100x+10y+z-16}{2}=100z+10y+x \qquad and \qquad x+y+z=20\\~\\ \)

Where x,y and z are single digit non-negative integers.  And   x and z  cannot be 0

 

 

Looking at

\(\frac{100x+10y+z-16}{2}=50x+5y+\frac{z}{2}-8\)

 

Z must be 2,4,6 or 8

 

Z, 10+Z

2,12

4,146,168,18
z/2, (10+Z)/21,62,73,84,9
z/2-8 (last digit)3,84,95,06,1
X3 or 84 or 95 or 06 or 1
x+y+z=20 therefor Y=no soln7 (using the 9)9 (using the 5)6(using the 6)
possible initial numbers 974596668

 

So  my possibilities so far are

974   and  596  abd 668

do they work though?    

the digits add to 20, that is good.

 

Try 974

(974-16)/2 = 479     The digits are reversed so that is perfect

 

Try 596

(596-16)/2 = 290     that is no good

Try 668

(668-16)/2 = 326     that is no good either.

 

So the only original number that works is    974

 

 

 

 

Coding:

\frac{100x+10y+z-16}{2}=100z+10y+x \qquad and \qquad x+y+z=20\\~\\

 Dec 15, 2019
edited by Melody  Dec 15, 2019
 #4
avatar+109064 
+2

Let the original number be  abc....so we can write

 

a + b + c   = 20

c = 20 - a - b

 

[100a  + 10b  + c  -16  ] / 2  =   100c + 10b  + a

 

100a  + 10b + c - 16   =   200c + 20b + 2a

 

100a + 10b + ( 20 - a - b) - 16  =  200 (20 - a - b)  + 20b + 2a

 

99a + 9b + 4   =  4000 - 200a - 200b + 20b + 2a

 

99a  + 9b + 4  =  4000 - 198a - 180b

 

297a + 189b  =  3996     divide both sides by 9

 

33a + 21b  = 444     divide  by 3  again

 

11a  +  7b  =  148

 

11a  =  148 - 7b

 

Note that  if  a = 9 , then b  =  7

 

And   c  =  20  - 9 - 7  =  4

 

So.....the original number is  974

 

Proof

 

[974 - 16]/ 2  =

 

958/2  =

 

479

 

 

cool cool cool

 Dec 15, 2019
edited by CPhill  Dec 15, 2019
 #5
avatar+108626 
+1

Attn: Asker guest.

 

There you go,

We have provided 3 very different ways of doing it.

And Dragan has checked the answer.    

 

Now you have to do  is say thanks and ask questions if you want.

 Dec 15, 2019

23 Online Users

avatar