# Properties of the Digit Product + Digit Sum of a number

The other day I started messing around with some properties and noticed a pattern emerging when the digit product and digit sum of a number were added together. For example, 15. (1+5)+(1*5) = 11. If you keep going you'll find a sequence that goes through every number from 1 to 18 exactly once.

Then if you go further you'll find that 19, and in fact any two-digit number ending in 9, refers to itself. (E.g. 59 = 5*9 + 5+9) You can prove this just by using two forms of these numbers: 10a + b = ab + a + b, which goes to 9a = ab, b=9.

Going further, I noticed that the form ab + a + b can be rewritten as (a+1)(b+1) - 1. So in general, above 19, the property of the number is one more than its tens digit times one more than its unit digit, minus one.

• 0 recalls itself
• 1 to 18 loop round in the sequence 1,2,4,8,16,13,7,14,9,18,17,15,11,3,6,125,10,1...
• 19 recalls itself
• 20 to 29 follow the form 3n - 1
• 30 to 39 follow the form 4n - 1 Etc...

I would like to know if there is any particular reason for the 1 to 18 sequence, or if there are any other loops, or if this sequence has a name.

Thanks

## 1 Answer

The main reason for the loop on numbers < 19 is that all of these numbers are trapped below 19. In fact, for any two digit number $10a + b$ we have $f(10a + b) = ab + a + b = a(b + 1) + b \le 10a + b$, since the maximum digit is 9. So $f$ is decreasing on two digit numbers. This breaks down for one digit numbers because for them $a = 0$, but $f$ no longer follows the same expression. So 1-digit numbers toss the sequence up, while 2-digit numbers bring it down. But the 1-digit numbers cannot toss higher than 18. Eventually, trapped below 19, you have to repeat yourself, and that point you have a loop. It is somewhat random (no result in mathematics is truly random) that there is one big loop instead of 2 or more smaller loops, or even a "loop-with-tail".

Any other 2-digit number will descend eventually to one of the fixed "9" numbers, or else fall into the loop at the bottom.

I have never heard of this this sequence myself, but I would not be surprised if someone has investigated it before. Thanks for sharing it. It is interesting.

• Thank you for the insight! Do you know what happens to numbers with more digits? I could probably comfortably say they are decreasing, but are there other patterns? – Stewart Sep 2 '15 at 7:39
• For 3 digits or higher $f$ is strictly decreasing, by a variant of my argument for two digits above. So all seeds eventually either hit one of the 2-digit $a9$ values or drop into the bottom loop. – Paul Sinclair Sep 3 '15 at 2:42