A343630 Coordinate triples (x(n), y(n), z(n); n >= 0) of the 3D spiral filling space with shells of increasing radius, using circles at fixed z-values which alternatingly move up and down as do the x-values.
0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 1, 0, -1, 0, 1, -1, -1, 0, -1, 0, -1, -1, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 0, 1, 0, 1, 1, -1, 0, 1, 0, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 0, 0, -2, 2, 0, 0, 0, 2, 0, -2, 0, 0, 0, -2, 0, 0, 0
Offset: 0
Keywords
Examples
Shell r = 0 is the origin, {(0,0,0)}. Shell r = 1 contains the 6 points {(0,0,1), (1,0,0), (0,1,0), (-1,0,0), (0,-1,0), (0,0,-1)}, located on the North pole, equator and South pole of the unit sphere. The equator (as all circles in the sequel) is "scanned" by increasing longitude = polar coordinate phi in the (x,y) plane with given z, where (x,y,z) = (R,0,0) has longitude 0. Shell r = R^2 = 2 contains the 12 points (now in order of increasing z-coordinate) {(1,0,-1), (0,1,-1), (-1,0,-1), (0,-1,-1); (1,1,0), (-1,1,0), (-1,-1,0), (1,-1,0); (1,0,1), (0,1,1), (-1,0,1), (0,-1,1)}. Then again, the points of shell r = R^2 = 3 are ordered by decreasing z-coordinate. There are no points in shell r = R^2 = 7 = A004215(1), so from there on up to the next empty shell, the shells with even r are filled by decreasing z-coordinate.
Crossrefs
Programs
-
PARI
A343630_row(n, dir=(-1)^n, Q=Qfb(1, 0, 1), L=List())={for(z=if(n, sqrtint((n-1)\3)+1), sqrtint(n), my(S=if(n>z^2, Set(apply(vecsort, abs(qfbsolve(Q, n-z^2, 3)))), [[0, 0]])); foreach(S, s, forperm(concat(s, z), p, listput(L, p)))); for(i=1, 3, for(j=1, #L, my(X=L[j]); (X[i]*=-1) && listput(L, X))); vecsort(L, (p, q)->if( p[3]!=q[3], (p[3]-q[3])*dir, p[1]==q[1], q[2]-p[2], p[2]*q[2]<0, q[2]-p[2], (q[1]-p[1])*(p[2]+q[2])))} \\ returns row n of the table, i.e., the list of points (x,y,z) in Z^3 with Euclidean norm equal to sqrt(n), sorted by increasing latitude for dir = +1, else decreasing, and increasing longitude. A343630_vec=concat([[Vec(P) | P<-A343630_row(n)] | n<-[0..6]]) \\ beyond the empty row 7 one must correct the second argument, e.g. by using {... P<-S=A343630_row(n,d)]+(#S&&!d*=-1) ...} to flip the sign of d, initialized to 1, at each nonempty shell.
Comments