Restricted mini challenges Robbers Thread
Haskell, xnor



s=show s
ss=show[[s]]
w h=[ss!!h]&lt;show[h]


Try it online!

The first line defines s as the fixed point of the show function, which is the infinite string

"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\...


It has "s at indices 0, 2, 6, 14, 30… Powers of two, minus two.

The second line defines ss as the string

[["\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\...


It has non-\s at indices 0, 1, 2, 4, 8, 16, 32… Powers of two, ignoring 0.

We’re in luck: in ASCII, " &lt; [ &lt; \, so we can write an indicator function for the less-than-backslashes in this string, and we’re done!

w h is our answer: it checks if the h’th element of ss is less than a backslash. Well, we can’t construct a string containing only a backslash, so we construct some other string that’s always bigger than "[", namely show[h].