Define the flipflop function, applied to a positive integer, as
the result of having the 10^2i and 10^(2i+1) digits switch places.
Moreover, if the integer has an odd number of digits, append
a leading zero to the left side of the number so that
it can flipflop with the first nonzero digit.
For example, flipflop(9876) = 8967 and flipflop(1234567) is 10325476.
warm-up:
What is the smallest positive integer such that flipflop(m) = m*4?
octuple the number:
What is the smallest positive integer such that flipflop(n) = n*8?
In the case of multiplication by 8, I have found only one solution: are there any others?
(In reply to
computer solution by Charlie)
Is it safe to say that your algorithm spends most of the time doing the flipflop? If we can weed out candidates before applying the flipflop that should speed things up.
Some elementary analysis:
Let f(x) denote the flipflop operation on natural number x.
For any natural number x, x and f(x) will be congruent mod 9, or equivalently f(x) - x = 0 mod 9.
In the warm-up problem f(m)=4m, which makes 4m - m = 0 mod 9, which reduces to m = 0 mod 3; m must be multiple of 3 to be a solution.
In the octuple problem f(n)=8n, which makes 8n - n = 0 mod 9, which reduces to n = 0 mod 9; n must be multiple of 9 to be a solution.
For any natural number x, x and f(x) will have opposing parity mod 11, or equivalently f(x) + x = 0 mod 11.
In the warm-up problem f(m)=4m, which makes 4m + m = 0 mod 11, which reduces to m = 0 mod 11; m must be multiple of 11 to be a solution.
In the octuple problem f(n)=8n, which makes 8n + n = 0 mod 11, which reduces to n = 0 mod 11; n must be multiple of 11 to be a solution.
So then by combining congruences we have that in the warm-up problem m must be a multiple of 33 and and in the octuple problem n must be a multiple of 99.
I would expect this to help speed up a computer search.