# [Jelly], 16 [bytes]

_Hmm, this may be incorrect even though it works for small \$N\$ as it assumes there will be perfect rulers of any length_

    ‘ŒPŒcIQLƲÐṀLÐṂṬṚ

A monadic Link that accepts the ruler length, \$N\$, and yields all perfect rulers of length \$N\$ as lists of binary marks ordered numerically.

**[Try it online!][TIO-m3etrb7l]** Or see the [test-suite].

#### How?

    ‘ŒPŒcIQLƲÐṀLÐṂṬṚ - Link: non-negative integer, N
    ‘                - increment {N} -> N+1
     ŒP              - powerset {[1..N+1]}
                       -> [[],[1],[2],...,[N+1],[1,2],[1,3],...,[1..N+1]]
             ÐṀ      - keep those maximal under:
            Ʋ        -   last four links as a monad:
       Œc            -     unordered pairs
         I           -     forward deltas
          Q          -     deduplicate
           L         -     length
                ÐṂ   - keep those minimal under:
               L     -   length
                  Ṭ  - untruth (convert to their binary representations)
                   Ṛ - reverse (equivalent to sorting by binary representation)


[Jelly]: https://github.com/DennisMitchell/jelly
[bytes]: https://github.com/DennisMitchell/jelly/wiki/Code-page

[TIO-m3etrb7l]: https://tio.run/##y0rNyan8//9Rw4yjkwKOTkr2DPQ5tunwhIc7G3xAZNPDnWse7pz1//9/MwA "Jelly – Try It Online"

[test-suite]: https://tio.run/##AUAAv/9qZWxsef//4oCYxZJQxZJjSVFMxrLDkOG5gEzDkOG5guG5rOG5mv/Dh1bFkuG5mOKBuCxq4oG@OsK2KVn//zEy "Jelly – Try It Online"