%I #22 Apr 04 2020 14:01:29
%S 0,1,4,5,8,9,12,13,20,24,25,48,49,50,73,84,100,103,104,105,108,109,
%T 110,200,243,244,245,246,273,620,621,646,647,648,653,654,661,664,665,
%U 666,2655,2656,2803,2804,2837,3212,3213,3214,3215,3216,3227,3228,3231,3232,3233,3234,3235
%N Use the Möbius (or Moebius) function mu(n) (A008683) to define a walk on a square lattice. A value of 1 is a move to the right, a value of -1 is a move to the left, and a value of 0 is a move either up or down depending on whether the previous nonzero value was +1 or -1. Sequence lists moves which reach a point that is further from the origin than any earlier move.
%e a(6) is 9. a(5) has a position on the Cartesian plane {-2, -2} and Möbius mu(9) is 0 and the previous nonzero was -1, resulted in a position of {-2, -3}; a distance further from the origin than a(5).
%t k = 1; flg = mxd = ns = ew = 0; lst = {0}; While[k < 1001, mu = MoebiusMu@ k; If[ Abs[mu] > 0, flg = mu; ns = ns + mu, ew = ew + flg]; d = ns^2 + ew^2; If[mxd < d, mxd = d; AppendTo[lst, k]]; k++]; lst
%Y Cf. A002321, A008683.
%K easy,nonn
%O 1,3
%A Hayden H. Rigdon and _Robert G. Wilson v_, Mar 18 2020