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

Home > Numbers
B-nary (Posted on 2009-04-27) Difficulty: 2 of 5
If b is an integer greater than 1, then a b-nary representation of a non-negative real number r is an expression of the form
           
     r = ∑ aib-i
          i=0
where a0 is a non-negative integer, and the ai are integers satisfying 0 ≤ ai < b for i = 1,2,3, ...
     r = a0.a1a2a3 ...

An underscored numeral will denote that the numeral is repeated indefinitely. If b=10 for example, then
     0.45783 denotes 0.45783783783783....

No matter what the base b, an irrational number has only one b-nary representation.

Looking at the table below we see that (depending on the base) a rational number can have one or two b-nary representations.

---------------+-----------------------+-----------------------+
          Base |           Ten         |          Three        |
---------------+------------+----------+------------+----------+
Representation |  fraction  |  b-nary  |  fraction  |  b-nary  |                     
---------------+------------+----------+------------+----------+
               |     1/3    |   0.3    |    1/10    |  0.10    |
               |            |          |            |   or     |
               |            |          |            |  0.02    |
---------------+------------+----------+------------+----------+
               |     1/5    |   0.20   |    1/12    |  0.0121  |
               |            |    or    |            |          |         
               |            |   0.19   |            |          |       
---------------+------------+----------+------------+----------+  
If p, q, and b are integers with p ≥ 0, q > 0, and b > 1, then what is the relation between p, q, and b such that the rational number p/q has only one b-nary representation?

See The Solution Submitted by Bractals    
Rating: 1.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: somewhat of a solution (some thoughts) Comment 2 of 2 |
(In reply to somewhat of a solution by Charlie)

first for simplicity let

n=q/gcd(p,q)

now as you pointed out we want

n mod b^k =0 for some integer k>0 now if

n mod b^k =0 then n mod b^t = 0 for all t>k

also if for some k with b^k>n we have that n mod b^k is not zero then we can stop looking because no further higher values of k can result in n mod b^k being zero

so if we want to find the largest k such that b^k<=n and then we can test if n mod b^k = 0 and this is simply when

b^k<=n

k<= ln(n)/ln(b)

thus if we set k=Floor( ln(n)/ln(b) ) then we can simply do the single test of

n mod b^k =0 and if this is true then there can be 2 representations as Charlie pointed out, otherwise there will be only one.

so put it all togeather and the relation is

(q/gcd(p,q)) mod b^floor( Ln(q/gcd(p,q))/Ln(b) ) = 0

Edited on April 27, 2009, 9:57 pm
  Posted by Daniel on 2009-04-27 21:44:10

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 (3)
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