Skip to main content
add highlighting
Source Link
chunes
  • 26.8k
  • 3
  • 24
  • 53

Factor + math.unicode, 23 bytes

[ 1 - 3 >base "10"⊂ ]
[ 1 - 3 >base "10"⊂ ]

Try it online!

Based on @allxy's Vyxal/Jelly answers. Subtract 1 from the input, convert it to base 3, but instead of checking whether each digit is less than two, we check whether the result is a subset of "10" since that's shorter in Factor.

Factor + math.unicode, 23 bytes

[ 1 - 3 >base "10"⊂ ]

Try it online!

Based on @allxy's Vyxal/Jelly answers. Subtract 1 from the input, convert it to base 3, but instead of checking whether each digit is less than two, we check whether the result is a subset of "10" since that's shorter in Factor.

Factor + math.unicode, 23 bytes

[ 1 - 3 >base "10"⊂ ]

Try it online!

Based on @allxy's Vyxal/Jelly answers. Subtract 1 from the input, convert it to base 3, but instead of checking whether each digit is less than two, check whether the result is a subset of "10" since that's shorter in Factor.

Source Link
chunes
  • 26.8k
  • 3
  • 24
  • 53

Factor + math.unicode, 23 bytes

[ 1 - 3 >base "10"⊂ ]

Try it online!

Based on @allxy's Vyxal/Jelly answers. Subtract 1 from the input, convert it to base 3, but instead of checking whether each digit is less than two, we check whether the result is a subset of "10" since that's shorter in Factor.