Inspiration - thanks to Michael Huang for posting the first problem.

A positive integer is written on a board. We repeatedly erase its unit digit and add $5$ times that digit to what remains.

Consider the sequence of numbers generated in this manner. What is the eventual behaviour of this sequence?

One or more of the following can happen: depending on the initial number on the board, the sequence...

- can tend to infinity
- can tend to a unique fixed value
- can tend to any one of several (finitely many, but more than one) fixed values
- can tend to any one of infinitely many fixed values
- can become periodic with a period length greater than $1$ but less than $10$
- can become periodic with a period length greater than or equal to $10$ but less than $100$
- can become periodic with a period length greater than or equal to $100$

Code the options you think are possible as a seven-digit binary number, and enter its decimal equivalent as your answer. For example, if you think the first, third and fifth options are possible, your binary number would be $1010100_2$ and you would enter $84$ as your answer.

[An example to clarify the answer options: if instead we looked at repeatedly summing the digits of a positive number, the only correct option would be the third one - it will always tend to a fixed, single digit value]

The answer is 38.

**
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.

The correct answer is $38=0100110_2$ .

One of three things can happen to the sequence:

The length $42$ cycle is made up of all the numbers $1$ to $48$ excluding multiples of $7$ .

To prove nothing else can happen, consider the map: we take a number of the form $10a+b$ (where $b$ is a single digit and $a$ is a non-negative integer) and replace it with $a+5b$ .

The difference of these is $\Delta=10a+b-(a+5b)=9a-4b$ . The largest $b$ can be (as a single digit) is $9$ ; so if $a>4$ then $\Delta>0$ , meaning that any number larger than $49$ is mapped to a smaller number. Eventually the terms must fall into the range $1$ to $49$ and become periodic (or fixed) as described above.