OFFSET
0,3
COMMENTS
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.
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . 14. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . 13. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 2 . 3 . . . . . . .
. . . . . . . . . . . 1 . . . . 4 . . . . .
. . . . . . . . . . . o . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 5 . . .
. . 12. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 6 . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . 11. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . 7 . . . .
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 10. . . . . . . . . . . . . .
. . . . . . . . . . . 9 . . . 8 . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
The name is chosen to mislead school students into making an incorrect hypothesis about the Babylonian Spiral's long-term behavior.
LINKS
Lars Blomberg, Table of n, a(n) for n = 0..10000
MathPickle, Babylonian Spiral
EXAMPLE
On the above diagram, point 4 is distance sqrt(26) from the origin, so a(4) = 26.
MATHEMATICA
NextVec[{x_, y_}] :=
Block[{n = x^2 + y^2 + 1}, While[SquaresR[2, n] == 0, n++];
TakeSmallestBy[
Union[Flatten[(Transpose[
Transpose[Tuples[{1, -1}, 2]] #] & /@
({{#[[1]], #[[2]]}, {#[[2]], #[[1]]}})) & /@
PowersRepresentations[n, 2, 2], 2]],
Mod[ArcTan[#[[2]], #[[1]]] - ArcTan[y, x], 2 Pi] &, 1][[1]]
]
Norm[#]^2 & /@ Accumulate[NestList[NextVec, {0, 1}, 50]] (* Alex Meiburg, Dec 29 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gordon Hamilton, Mar 14 2015
EXTENSIONS
Corrected a(16) and more terms from Lars Blomberg, Nov 17 2016
STATUS
approved