<?xml version="1.0" encoding="UTF-8"?><oembed><type>video</type><version>1.0</version><html>&lt;iframe src=&quot;https://www.loom.com/embed/e0270aad10e24acca1e967686f465c99&quot; frameborder=&quot;0&quot; width=&quot;1248&quot; height=&quot;936&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;</html><height>936</height><width>1248</width><provider_name>Loom</provider_name><provider_url>https://www.loom.com</provider_url><thumbnail_height>936</thumbnail_height><thumbnail_width>1248</thumbnail_width><thumbnail_url>https://cdn.loom.com/sessions/thumbnails/e0270aad10e24acca1e967686f465c99-59065a6bfc6df01e.gif</thumbnail_url><duration>368.403</duration><title>Generating the Regular Paperfold Sequence in C#</title><description>This Loom demonstrates how to implement a generator for the regular paper-fold (dragon curve) sequence in C#. It explains that the sequence is formed by taking each intermediate sequence as a prefix of the next and defining the limit by inserting an alternating pattern of 1s and 0s between existing terms. The initial C# attempt based on parity of trailing zeros did not work, so the logic was corrected: for position n starting at 1, remove all factors of 2 from n and return 1 if the odd part is 1 mod 4, otherwise return 0 if it is 3 mod 4. The updated code is tested and appears to produce the expected output.</description></oembed>