This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A256111 #35 Sep 14 2018 06:22:36 %S A256111 0,1,5,13,26,50,65,85,116,100,97,85,85,90,128,205,293,409,481,586,730, %T A256111 845,890,841,833,745,514,244,65,17,106,338,698,1117,1225,1193,1040, %U A256111 986,1037,1060,850,477,197,85,80,232,530,757,650,522,225,16,50,333,797 %N A256111 a(n) = squared distance to the origin of the n-th vertex on a Babylonian Spiral. %C A256111 A Babylonian spiral is constructed by starting with a zero vector and progressively concatenating the next longest vector with integral endpoints on a Cartesian grid. (The squares of the lengths of these vectors are A001481.) The direction of the new vector is chosen to create the clockwise spiral which minimizes the change in direction from the previous vector. %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . 14. . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . 13. . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . 2 . 3 . . . . . . . %C A256111 . . . . . . . . . . . 1 . . . . 4 . . . . . %C A256111 . . . . . . . . . . . o . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . 5 . . . %C A256111 . . 12. . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . 6 . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . 11. . . . . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . . . . . . . 7 . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 . . . . . . . 10. . . . . . . . . . . . . . %C A256111 . . . . . . . . . . . 9 . . . 8 . . . . . . %C A256111 . . . . . . . . . . . . . . . . . . . . . . %C A256111 The name is chosen to mislead school students into making an incorrect hypothesis about the Babylonian Spiral's long-term behavior. %H A256111 Lars Blomberg, <a href="/A256111/b256111.txt">Table of n, a(n) for n = 0..10000</a> %H A256111 Lars Blomberg, Illustrations of <a href="/A256111/a256111.png">100</a>, <a href="/A256111/a256111_1.png">1000</a> and <a href="/A256111/a256111_2.png">10000</a> terms %H A256111 MathPickle, <a href="http://mathpickle.com/project/babylonian-spiral">Babylonian Spiral</a> %e A256111 On the above diagram, point 4 is distance sqrt(26) from the origin, so a(4) = 26. %t A256111 NextVec[{x_, y_}] := %t A256111 Block[{n = x^2 + y^2 + 1}, While[SquaresR[2, n] == 0, n++]; %t A256111 TakeSmallestBy[ %t A256111 Union[Flatten[(Transpose[ %t A256111 Transpose[Tuples[{1, -1},2]] #] & /@ %t A256111 ({{#[[1]], #[[2]]}, {#[[2]], #[[1]]}})) & /@ %t A256111 PowersRepresentations[n, 2, 2], 2]], %t A256111 Mod[ArcTan[#[[2]], #[[1]]] - ArcTan[y, x], 2 Pi] &, 1][[1]] %t A256111 ] %t A256111 Norm[#]^2 & /@ Accumulate[NestList[NextVec, {0, 1}, 50]] (* _Alex Meiburg_, Dec 29 2017 *) %Y A256111 x-coordinates given in A297346. y-coordinates given in A297347. %K A256111 nonn %O A256111 0,3 %A A256111 _Gordon Hamilton_, Mar 14 2015 %E A256111 Corrected a(16) and more terms from _Lars Blomberg_, Nov 17 2016