%N Least number m, written in base 10, such that m/2 is obtained merely by shifting the leftmost digit of m to the right end, and 2m by shifting the rightmost digit of m to the left end, digits defined in base n.
%C Serves as an extension to A159774, which misses proper representation for solutions beyond base 12.
%C Algorithm: write m in base b with LSB d_0, k middle digits d_m, and MSB digit d_e as m=d_0+d_m*b+d_e*b^(k+1).
%C Demand m/2 = d_e+d_0*b_d_m*b^2 and 2*m=d_m+d_e*b^k+d_0*b^(k+1). Mix these to obtain m*(2b-1)=2*d_e*(b^(k+2)-1).
%C Loop over (outer loop) k=0,1,2... and (inner loop d_e=0.. b-1 to obtain integer m to be checked against the condition.
%Y Cf. A159774.
%A _Ray Chandler_ and _R. J. Mathar_, Apr 23 2009