OFFSET
1,3
COMMENTS
The "Babylonian Spiral" is defined and illustrated in A256111.
LINKS
Alex Meiburg, Table of n, a(n) for n = 1..10000
MathPickle, Babylonian Spiral
EXAMPLE
The first few points are (0,0), (0,1), (1,2), (3,2) -- thus the sequence starts out 0, 1, 2, 2.
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]]
]
Accumulate[NestList[NextVec, {0, 1}, 500]][[;; , 2]]
CROSSREFS
KEYWORD
AUTHOR
Alex Meiburg, Dec 28 2017
STATUS
approved