Find the binary period
Jelly, 9 bytes

2*Ɱ%µẠȧQL


A monadic Link accepting a positive integer, n, which yields a positive integer, the period.

Try it online! Or see the test-suite.

How?

2*Ɱ%µẠȧQL - Link: integer, n
2         - literal two
  Ɱ       - map across [1..n]
 *        - exponentiate -&gt; [1,2,4,8,...,2^n]
   %      - modulo n -&gt; [1%n,2%n,4%n,8%n,...,2^n%n]
    µ     - start a new monadic chain - call that X
     Ạ    - all (X)? -&gt; 0 if we reach zero, else 1 - i.e. 0 if n is a power of 2
       Q  - de-duplicate (X) -&gt; the repeating 2^k%n values 
      ȧ   - logical AND -&gt; 0 if n is a power of 2 else Q(X)
        L - length (0 has a length of 1 (after an implicit make_digits))