Find the smallest value of hexadecimal positive integer N which becomes 4*N when the last digit of N is moved to be the first. For example, turning (2345)_{16} into (5234)_{16}. How about 2*N? 7*N? 8*N?
(In reply to
7*n, analytically by Steve Herman)
I had also been working on an analytical solution, with some use of inspection. The answer I found was a little smaller.
A hexadecimal number for N can be represented as
16^{n}a_{0}+16^{n1}a_{1}+...+16^{1}a_{n1}+16^{0}a_{n}.
Thus, what is sought is where
7×(16^{n}a_{0}+16^{n1}a_{1}+...+16^{1}a_{n1}+16^{0}a_{n})
= 16^{n}a_{n}+16^{n1}a_{0}+...+16^{1}a_{n2}+16^{0}a_{n1}.
Let D = 16^{n1}a_{0}+...+16^{1}a_{n2}+16^{0}a_{n1}, then
7×(16D + a_{0}) = 16^{n}a_{0} + D, which can be expressed similar to your expression as D = a_{n}×(16^{n}7)/111
Using Excel to iterate through 1 to 15 to find n (which will result in an integer), it is found that n = 8, (or n = 12 : a_{12} = 6), which gives a_{8}×(38693399).
Thus 7×N = a_{8}×(16^{8 }+ 38693399) = a_{8}×(4333660695).
Iterating values 1 to 15 for a_{8} finds the first value where the second digit of 7×N in hexadecimal is not the digit 0 (as a leading 0 digit would not be permitted) is where a_{8 }= 7.
7×N = 30335624865 = 71024E6A1_{16}, and
N = 4333660695 = 1024E6A17_{16}.
Edited on December 24, 2014, 8:06 am

Posted by Dej Mar
on 20141224 08:06:23 