Output Number Thinking

Assume input N \text{N} is a 2-digit positive number, then following these instructions:

1. 1. Multiply by 3 3 .

2. 2. Subract quadruple of N \text{N} 's digit sum.

3. 3. Subract double of N \text{N} 's digit product, then that's the output number O \text{O} .

For example, if the input N \text{N} is 28 28 , then the output O \text{O} is 12 12 .

Some of input N \text{N} 's value is same as output O \text{O} 's, then what's the sum of O \text{O} 's value?


The answer is 127.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Vincent Huang
Jan 23, 2021

Algebra solution:

According to instructions, we get the equation

3 ( 10 a + b ) 4 ( a + b ) 2 a b = 10 a + b \begin{aligned} 3(10a+b)-4(a+b)-2ab&=10a+b\\ \end{aligned}

Then rearrange it, we get

b = 8 a a + 1 b=\frac{8a}{a+1}

So the output value O \text{O} can be 14 , 36 , 77 14,36,77 .

Therefore, the sum of the answer is 127 \boxed{127} .


Coding solution:

1
2
3
4
5
6
7
8
9
for N in range(10,100):
  a=int((N-(N%10))/10)
  b=N%10
  S=a+b
  P=a*b
  O=3*N-4*S-2*P;
  if(N==O):
    print(N)
#The output is 14,36,77.

Sathvik Acharya
Jan 23, 2021

N = a b N=\overline{ab} N = 10 a + b \implies N=10a+b\; Following the given instructions, N = 10 a + b 30 a + 3 b 30 a + 3 b 4 ( a + b ) 30 a + 3 b 4 ( a + b ) 2 ( a b ) = O N=10a+b\; {\color{#3D99F6}\longrightarrow}\; 30a+3b\; {\color{#3D99F6}\longrightarrow}\; 30a+3b-4(a+b) \; {\color{#3D99F6}\longrightarrow}\; 30a+3b-4(a+b)-2(ab)=O If N = O N=O , 10 a + b = 30 a + 3 b 4 a 4 b 2 a b 0 = 16 a 2 b 2 a b b ( a + 1 ) = 8 a b = 8 a a + 1 \begin{aligned} 10a+b&=30a+3b-4a-4b-2ab \\ 0&=16a-2b-2ab \\ b(a+1)&=8a \implies b=\frac{8a}{a+1} \\ \end{aligned} Since a a and a + 1 a+1 do not share a common factor (two consecutive numbers are always co-prime) and b b is an integer, a + 1 a+1 must divide 8 8 .

Hence, a + 1 { 2 , 4 , 8 } a { 1 , 3 , 7 } ( a , b ) { ( 1 , 4 ) , ( 3 , 6 ) , ( 7 , 7 ) } N { 14 , 36 , 77 } a+1\in \{2,4,8\}\implies a\in \{1,3,7\}\implies (a,b)\in \{(1,4),(3,6),(7,7)\}\implies N\in \{14,36,77\}

Therefore, the sum of all possible values of O O is 14 + 36 + 77 = 127 14+36+77=\boxed{127}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...