Ulam Spiral in 4v

Hi everyone. For a couple of days now I’m trying to generate Ulam Spiral in 4v:


But Im stuck on several attempts to generate appropriate XY values spread to generate this square spiral that starts at 0.0. This is more difficult than I thought. Do I have to eventually write in C# my own node or this is actualy posible to make using spreads? I have run out of ideas.

Thanks in advance for any help.

although it would be possible with spreads, it seems much easier to write a dynamic plugin for it…