Skip to main content
added 34 characters in body
Source Link
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?

updating...

BŒṖŒɠ€Ṃ€’Ẹµ#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 fortruthy eachunder:
       Ɗ    -       last three links as a monad, f(partition):
   Œɠ        -         run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
            -     for each (run-length list):
 minimum
           -       minimum
        ’    -     decrement (vectorises)
         -     any? (effectively> any0 non-zero?is i.e.falsey, doesother anynumbers partitionare consisttruthy
                        (a solelyresult of runsf(k) ofwhich lengthis 2non-empty oris more?truthy)

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?

updating...

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)
            -     for each (partition):
   Œɠ        -       run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
            -     for each (run-length list):
            -       minimum
        ’    -     decrement (vectorises)
         -     any? (effectively any non-zero? i.e. does any partition consist
                         solely of runs of length 2 or more?)

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)
added 34 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 12 12  11 bytes

BŒṖŒɠ€Ṃ€’Ẹµ#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!Try it online!

How?

updating...

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)
     €       -     for each (partition):
   Œɠ        -       run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
       €     -     for each (run-length list):
      Ṃ      -       minimum
        ’    -     decrement (vectorises)
         Ẹ   -     any? (effectively any non-zero? i.e. does any partition consist
                         solely of runs of length 2 or more?)

Jelly, 12 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)
     €       -     for each (partition):
   Œɠ        -       run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
       €     -     for each (run-length list):
      Ṃ      -       minimum
        ’    -     decrement (vectorises)
         Ẹ   -     any? (effectively any non-zero? i.e. does any partition consist
                         solely of runs of length 2 or more?)

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?

updating...

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)
     €       -     for each (partition):
   Œɠ        -       run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
       €     -     for each (run-length list):
      Ṃ      -       minimum
        ’    -     decrement (vectorises)
         Ẹ   -     any? (effectively any non-zero? i.e. does any partition consist
                         solely of runs of length 2 or more?)
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 12 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)
     €       -     for each (partition):
   Œɠ        -       run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
       €     -     for each (run-length list):
      Ṃ      -       minimum
        ’    -     decrement (vectorises)
         Ẹ   -     any? (effectively any non-zero? i.e. does any partition consist
                         solely of runs of length 2 or more?)