All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Move the digit, Change the base (Posted on 2022-04-19) Difficulty: 3 of 5
Find the smallest positive base 10 integer, for each of (a) through (d), (but with a 3-digit minimum), such that moving a digit is equivalent to changing the base from 10 to some other base which you must determine, according to one specific condition below:

(a) Moving a 6 from last digit to first changes from base 10 to a smaller base
(b) Moving a 3 from first digit to last changes from base 10 to a smaller base
(c) Moving a 2 from last digit to first changes from base 10 to a larger base
(d) Moving an 8 from first digit to last changes from base 10 to a larger base

Note: The new base may be different for each of (a) to (d)

No Solution Yet Submitted by Larry    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(6): computer exploration -- c and d finally | Comment 9 of 10 |
(In reply to re(5): computer exploration -- c and d finally by Larry)

Ah, not a typo but a bug:


The two incompatible statements are highlighted:

for i=[  200:299  2000:2999]
  n=flip(char(string(i)));
  nr=[n( end) n(1:end-1)];
  for b=11:36
    
    if base2dec(nr,b)==i
      disp([n ' ' nr ' ' char(string(b))])
    end
    
  end
end

The value of n is flipped left-to-right from i, so that i could be in ranges without step values, but the comparison is against the unflipped original. The correct code

for i=[  200:299  2000:2999]
  n=flip(char(string(i)));
  nr=[n( end) n(1:end-1)];
  for b=11:36
    
    if base2dec(nr,b)==str2double(n)
      disp([n ' ' nr ' ' char(string(b))])
    end
    
  end
end

compares against the one from which the moved 2 came.

It now, finally(I hope), finds

782 278 18
882 288 19
5272 2527 13

the first of which is that 782 in decimal, translated to base 18 is written as 278.

  Posted by Charlie on 2022-04-20 14:46:17
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information