Post History
BQN, 17 bytesSBCS {π©βΎ1πββ βπ©β2|π©+Γ·2} Run online! BQN primitives alone can't express unbounded iteration, so this must be a recursive block function. {π©βΎ1πββ βπ©β2|π©+Γ·2} # Function π taking argu...
Answer
#1: Initial revision
# [BQN](https://mlochbaum.github.io/BQN/), 17 bytes<sup>[SBCS](https://github.com/mlochbaum/BQN/blob/master/commentary/sbcs.bqn)</sup> ``` {π©βΎ1πββ βπ©β2|π©+Γ·2} ``` [Run online!](https://mlochbaum.github.io/BQN/try.html#code=SlPihpB78J2VqeKIvjHwnZWK4o2f4omg4oyK8J2VqeKLhjJ88J2VqSvDtzJ9CgriiY3LmOKfnChKU8KoKSAyK+KGlTk=) BQN primitives alone can't express unbounded iteration, so this must be a recursive [block](https://mlochbaum.github.io/BQN/doc/block.html) function. ``` {π©βΎ1πββ βπ©β2|π©+Γ·2} # Function π taking argument π© Γ·2 # Reciprocal of 2 (one half) π©+ # Plus π© 2| # Modulo 2 π©β # π© power β # Floor π # Keep going 1 ββ # ...if not 1 π©βΎ # Prepend π© ``` `1πββ β¦` passes 1 as the left argument `π¨`, which is harmless.