A104013 First digit-cycle of binary expansion of 1/n. Any initial 0's are to be placed at end of cycle.
0, 0, 10, 0, 1100, 10, 100, 0, 111000, 1100, 1011101000, 10, 100111011000, 100, 1000, 0, 11110000, 111000, 110101111001010000, 1100, 110000, 1011101000, 10110010000, 10, 10100011110101110000, 100111011000, 100101111011010000
Offset: 1
Examples
1/5 = 0.00110011001100... in binary, so a(5) = 1100.
Links
- Andrey Zabolotskiy, Table of n, a(n) for n = 1..1018
Programs
-
Mathematica
f[n_] := If[IntegerQ@ Log2@ n, 0, FromDigits[ RealDigits[1/n, 2][[1, 1]]]]; Array[f, 27] (* Robert G. Wilson v, Sep 01 2015 *)