I’m not OP, but if I were solving this I’d just take the smallest square less than that number, figure out where it is (the top left or bottom right corner), and then “run” the algorithm from there, which should only require one “turn” at the most. You really don’t need to know anything about spirals in particular; just look for a pattern that you can take advantage of to reduce your work.
Oh, I didn't see that. The Advent of Code website is strangely annoying in that it makes it extremely difficult to find past problems…
Based on what I found online (which is abridged rewordings of the problem, something of a sequence sum?) I'd get lazy at that point and implement something that makes the spiral. Presumably, this shouldn't take to long, as the sequence grows rapidly so they can't give us a number that's too big…
I was not particularly fast that day. If I recall correctly, I just bruteforced it (implemented the four-turn logic). Not elegant but it runs fast enough :)