Skip to main content
added 17 characters in body
Source Link
lyxal
  • 35.8k
  • 2
  • 70
  • 148

Vyxal, 32 bytes

ʀ>ṅʀ>

Try it Online!Try it Online!

Outputs as a list.

Explained

ʀ>ṅ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌­
ʀ    # ‎⁡                0..x
 >   # ‎⁢[x > n for n in     ]
  ṅ  # ‎⁣join into a single string
💎

Created with the help of Luminespire.

Vyxal, 3 bytes

ʀ>ṅ

Try it Online!

Explained

ʀ>ṅ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌­
ʀ    # ‎⁡                0..x
 >   # ‎⁢[x > n for n in     ]
  ṅ  # ‎⁣join into a single string
💎

Created with the help of Luminespire.

Vyxal, 2 bytes

ʀ>

Try it Online!

Outputs as a list.

Explained

ʀ>ṅ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌­
ʀ    # ‎⁡                0..x
 >   # ‎⁢[x > n for n in     ]
  ṅ  # ‎⁣join into a single string
💎

Created with the help of Luminespire.

deleted 129 characters in body
Source Link
lyxal
  • 35.8k
  • 2
  • 70
  • 148

Vyxal, 43 bytes

›E⇩Πʀ>ṅ

Try it Online!

Gets slow for large inputs because it's evaluating \$2^x\$. The output for number $x$ is \$2^{x+1} - 2\$ (x + 1 bits, with the last bit 0).Try it Online!

Explained

›E⇩Π­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌­ʀ>ṅ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌­
›Eʀ    # ‎⁡(input + 1) ** 2
     # ‎⁢- 2     0..x
 >   Π# ‎⁢[x > n for n in     ]
  ṅ  # ‎⁣to‎⁣join binaryinto a single string
💎

Created with the help of Luminespire.

Vyxal, 4 bytes

›E⇩Π

Try it Online!

Gets slow for large inputs because it's evaluating \$2^x\$. The output for number $x$ is \$2^{x+1} - 2\$ (x + 1 bits, with the last bit 0).

Explained

›E⇩Π­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌­
›E    # ‎⁡(input + 1) ** 2
     # ‎⁢- 2
   Π  # ‎⁣to binary
💎

Created with the help of Luminespire.

Vyxal, 3 bytes

ʀ>ṅ

Try it Online!

Explained

ʀ>ṅ­⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌­
ʀ    # ‎⁡                0..x
 >   # ‎⁢[x > n for n in     ]
  ṅ  # ‎⁣join into a single string
💎

Created with the help of Luminespire.

Source Link
lyxal
  • 35.8k
  • 2
  • 70
  • 148

Vyxal, 4 bytes

›E⇩Π

Try it Online!

Gets slow for large inputs because it's evaluating \$2^x\$. The output for number $x$ is \$2^{x+1} - 2\$ (x + 1 bits, with the last bit 0).

Explained

›E⇩Π­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌­
›E    # ‎⁡(input + 1) ** 2
  ⇩   # ‎⁢- 2
   Π  # ‎⁣to binary
💎

Created with the help of Luminespire.