OFFSET
1,4
COMMENTS
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, 1 along the positive x-axis, and so on. After 3, 6, 9, 12, 15 etc steps we have returned to the space diagonal (with equal x, y and z coordinates).
This sequence gives the floor of the Euclidean distance to the origin after n steps.
FORMULA
a(n) ~ n/sqrt(3). - Charles R Greathouse IV, May 02 2013
a(n) = floor(sqrt(A008810(n))), where A008810(n) is the squared Euclidean distance after n steps. - R. J. Mathar, May 02 2013
PROG
(JavaScript)
p = new Array(0, 0, 0);
for (a = 1; a < 100; a++) {
p[a%3] += 1;
document.write(Math.floor(Math.sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2])) + ", ");
}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jon Perry, May 02 2013
STATUS
approved