[net.math] binary expansion of 1/n

colonel@sunybcs.UUCP (George Sicherman) (11/21/83)

Computer trivia question:  what's the least positive integer n
such that the binary expansion of 1/n has more 1's than 0's?

bob@burdvax.UUCP (11/23/83)

The least positive integer, n, for which the binary expansion of 1/n
contains more 1's than 0's is:

    1 = 0.11111111 . . .

bob@burdvax.UUCP (11/28/83)

The least positive integer n for which the non-trivial binary
expansion of 1/n contains more 1's than 0's is 187.
The binary expansion of 1/187 has a 40-bit period containing 21 1's
and 19 0's.

The table below shows all values of n < 1000 which share this property.
This was achieved by brute force investigation (with grateful
acknowledgement to the Vax 11/780).  Does anyone have a generating function
for such numbers?


  n  period 1's  0's
 --- ------ ---  ---
 187   40   19   21
 323   72   35   37
 374   40   19   21
 427   60   28   32
 549   60   29   31
 559   84   41   43
 646   72   35   37
 687   76   37   39
 721   51   25   26
 748   40   19   21
 779  180   85   95
 781   70   32   38
 854   60   28   32
 927  102   50   52
 937  117   58   59
 965   96   47   49
 973  138   65   73

ka@hou3c.UUCP (Kenneth Almquist) (11/30/83)

The question does not specificly say that leading and trailing zeros are
to be counted.  If they are not counted, then the answer is n = 1.  If
leading and trailing zeros *are* to be included, then the number of zero
digits will be infinite for any n.  This means that the number of zero
digits will be equal to the total number of digits.  Since the number of
one's digits cannot be greater than the total number of digits, the number
of one's digits cannot be greater than the number of zero digits for any
n.

The preceding paragraph may be a little dense, but the important point
is that the concept of greater than is somewhat nonintuitive when infinite
quantities are involved.
					Kenneth Almquist

thomas@utah-gr.UUCP (Spencer W. Thomas) (12/01/83)

It was "obvious" to me that what the original question meant was
	1. Consider all and only the digits following the binary point
(including trailing zeros).
	2. It was really asking for the first fraction where the *ratio*
of 1s to 0s was greater than 1.

=Spencer