# [Retina], 18 bytes .+ $* (^1?|11\1)+$ [Try it online!][TIO-j3odk4xf] Shamelessly adapted from @MartinEnder's answer to https://codegolf.stackexchange.com/questions/122087 but with the base conversion included at a cost of 6 bytes. Note that Is this number triangular? wasn't for some inexplicable reason required to support zero as a triangular number, so part of the adaption was to add a `?` to make the leading 1 optional, allowing the group to match the empty string, and therefore a zero input. However, having immediately matched the empty string, the `+` operator stops repeating, to avoid the infinite loop that would happen if it kept greedily matching the empty string (after all, `^1?` would certainly keep matching). This means that it doesn't even try to match the other alternative in the group, thus avoiding the match of 2, 6, 12 etc. As @MartinEnder points out, a simpler way to avoid that while still matching the empty string is to anchor the match at the start while making the group optional for the same byte count: `^(^1|11\1)*$`. [Retina]: https://github.com/m-ender/retina [TIO-j3odk4xf]: https://tio.run/##K0otycxL/K@q4Z7wX0@bS0WLSyPO0L7G0DDGUFNb5f9/Ay5DLjMTLgsLAA "Retina – Try It Online"