login
Floor of the Euclidean distance of a point on the (1, 1, 1; 2, 2, 2) 3D walk.
2

%I #20 Mar 14 2015 01:00:13

%S 0,1,1,1,3,4,5,7,9,10,13,15,17,20,23,25,29,33,36,40,44,48,53,58,62,67,

%T 73,77,84,89,95,102,108,114,121,128,135,143,150,157,166,174,181,190,

%U 199,207,217,226,235,245,255,265,275,286,296,307,318,329,341,352,363,376

%N Floor of the Euclidean distance of a point on the (1, 1, 1; 2, 2, 2) 3D walk.

%C Consider a standard 3-dimensional Euclidean lattice. We take 1 step along the positive x-axis, 1 along the positive y-axis, 1 along the positive z-axis, 2 along the positive x-axis, and so on.

%C This sequence gives the floor of the Euclidean distance to the origin after n steps.

%C The coordinates are (0,0,0), (1,0,0), (1,1,0), (1,1,1), (3,1,1), (3,3,1), (3,3,3), (6,3,3),... where the x, y and z-coordinates run through A000217. The squared distances are s = 0, 1, 2, 3, 11, 19, 27, 54,... which obey an 11th-order linear recurrence with g.f. -x*(1+4*x^3+x^6) / ( (1+x+x^2)^3*(x-1)^5), a(n) = floor(sqrt(s(n))). - _R. J. Mathar_, May 02 2013

%o (JavaScript)

%o p = new Array(0, 0, 0);

%o for (a = 1; a < 100; a++) {

%o p[a % 3] += Math.ceil(a/3);

%o document.write(Math.floor(Math.sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2])) + ", ");

%o }

%Y Cf. A213172, A225215.

%K nonn

%O 0,5

%A _Jon Perry_, Apr 22 2013