Skip to main content
3 of 3
added 34 characters in body
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly,  12  11 bytes

BŒṖŒɠṂ’ƊƇµ#

A full program that accepts a positive integer, \$n\$, from STDIN and prints a list of the first \$n\$ emanresu numbers.

Try it online!

How?

BŒṖŒɠṂ’ƊƇµ# - Main Link: no arguments
          # - start with k=0 and count up, collecting the first n (from STDIN) k
              which are truthy under:
         µ  -   the monadic chain, f(k):
B           -     convert (k) to binary
 ŒṖ         -     all partitions (of the binary representation of k)
        Ƈ   -     filter - keep those (partitions) which are truthy under:
       Ɗ    -       last three links as a monad, f(partition):
   Œɠ       -         run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
     Ṃ      -         minimum
      ’     -         decrement (vectorises) -> 0 is falsey, other numbers are truthy
                (a result of f(k) which is non-empty is truthy)
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282