# [Jelly], 16 [bytes] ‘Œ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? The ruler of length \$N\$ with all \$N+1\$ marks is complete, so there is at least one complete ruler of any length \$N\$ and therefore there is at least one perfect ruler of length \$N\$ (it could be the aforementioned complete ruler, albeit unlikely). Thus I believe we can just look for those with maximal measuring capability and then filter these down to those with the fewest marks. (Please correct me if I've made a false assertion!) ‘Œ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]] i.e. all rulers of length <=N where the "0 mark" is allowed to be higher (e.g. [1,3,8] & [2,4,9] both represent [0,2,7]) ÐṀ - 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"