View Single Post
Old 05-30-2013, 12:13 PM   #6
NN5I
Carl, nn5i
 
NN5I's Avatar
 
Join Date: Sep 2011
Location: Tallahassee, FL
Posts: 1,441
Default

OK, KV4MJ came up with another algorithm, so now there are at least three. Let's call the original number (such as 111) to be a set of three individual digits abc, where a is the hundreds digit, b is the tens digit, and c is the ones digit.

FIRST ALGORITHM

result = 10c + (a+b+c)

This gives:

111 --> 13
112 --> 24
113 --> 35
114 --> 46
115 --> 57
116 --> 68
117 --> 79
118 --> 90
119 --> 101

SECOND ALGORITHM

Result = a two-piece string. The first piece is always one digit, and is the third digit (c) of the input. The second piece is one or two digits, equal to the sum of the three input digits (a+b+c).

This gives:

111 --> 13
112 --> 24
113 --> 35
114 --> 46
115 --> 57
116 --> 68
117 --> 79
118 --> 810
119 --> 911

THIRD ALGORITHM (KV4MJ's algorithm as I see it)

Result = a two-digit number. The first digit is just the ones digit (c) of the input. The second digit is the ones digit of the sum of the three input digits (a+b+c).

This gives:

111 --> 13
112 --> 24
113 --> 35
114 --> 46
115 --> 57
116 --> 68
117 --> 79
118 --> 80
119 --> 91

Any of these, and probably many more, will meet the requirements stated in the problem. What algorithm did you have in mind, Wade?
__________________
-- Carl
NN5I is offline   Reply With Quote