A343640
Coordinate triples (x(n), y(n), z(n); n >= 0) of the 3D square spiral filling space with shells of increasing radius for the sup-norm, in turn filled by squares extending from one pole to the opposite one.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, -1, 1, 1, -1, 0, 1, -1, -1, 1, 0, -1, 1, 1, -1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, -1, 1, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, -1, 1, 1, -1, 0, 1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, 0, 0, -1, 0, 0, -2, 1, 0, -2, 1, 1, -2, 0, 1, -2, -1, 1, -2, -1, 0, -2, -1, -1, -2, 0, -1, -2, 1, -1, -2
Offset: 0
Shell r = 0 is the origin, {(0,0,0)}.
Shell r = 1 contains the 3*3 + 4*2 + 3*3 = 26 points with oo-norm 1, i.e., all points with coordinates within {-1, 0, 1} except for the origin. They are listed in a square spiral starting at the North Pole: (0,0,1), (1,0,1), (1,1,1), (0,1,1), (-1,1,1), (-1,0,1), (-1,-1,1), (0,-1,1), (1,-1,1); then on the equator: (1,0,0), (1,1,0), (0,1,0), (-1,1,0), (-1,0,0), (-1,-1,0), (0,-1,0), (1,-1,0), and then on the South face using an inward spiral: (1,0,-1), (1,1,-1), (0,1,-1), (-1,1,-1), (-1,0,-1), (-1,-1,-1), (0,-1,-1), (1,-1,-1), (0,0,-1).
Since there are no empty shells, the z-coordinate is always increasing for even r and decreasing for odd r.
-
A343640_row(n)={local(L=List(), a(r, z, d=I)= if(r, for(i=1,8*r, listput(L,[real(r),imag(r),z]); r+=d; abs(real(r))==abs(imag(r)) && d*=I), listput(L,[0,0,z])), s=(-1)^n /* flip South <-> North for odd n */); /* main prog: (1) square spiral on South face from center to board */ for(d=!n,n, a(d,-s*n)); /* (2) "equatorial(?) bands" from South to North */ for(z=1-n,n-1, a(n,s*z)); /* (3) square spiral on North face ending in pole */ for(d=0,n, a(n-d,s*n)); Vec(L)} \\ row n of the table = list of points (x,y,z) in the shell n, i.e., with sup norm n. [Missing "s*" in a(n,s*z) added on May 27 2021]
A343640_vec=concat([A343640_row(r) | r<-[0..2]]) \\ From r=0 up to n there are (2n+1)^3 points with 3 coordinates each!
A342561
List points (x,y,z) having integer coordinates, sorted first by R^2 = x^2 + y^2 + z^2 and in case of ties, then by z and last by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives x-coordinates.
Original entry on oeis.org
0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 0, 1, -1, -1, 1, 1, 0, -1, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 2, 0, -2, 0, 0, 1, 0, -1, 0, 2, 0, -2, 0, 2, 1, -1, -2, -2, -1, 1, 2, 2, 0, -2, 0, 1, 0, -1, 0, 1, -1, -1, 1, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2, 1, -1, -1, 1, 2, 0, -2, 0, 2, -2, -2, 2, 2, 0, -2, 0
Offset: 0
n x y z R^2 phi/Pi
0 0 0 0 0 0.000
1 0 0 -1 1 0.000
2 1 0 0 1 0.000
3 0 1 0 1 0.500
4 -1 0 0 1 1.000
5 0 -1 0 1 1.500
6 0 0 1 1 0.000
7 1 0 -1 2 0.000
8 0 1 -1 2 0.500
9 -1 0 -1 2 1.000
10 0 -1 -1 2 1.500
11 1 1 0 2 0.250
12 -1 1 0 2 0.750
13 -1 -1 0 2 1.250
14 1 -1 0 2 1.750
15 1 0 1 2 0.000
16 0 1 1 2 0.500
17 -1 0 1 2 1.000
18 0 -1 1 2 1.500
19 1 1 -1 3 0.250
20 -1 1 -1 3 0.750
21 -1 -1 -1 3 1.250
22 1 -1 -1 3 1.750
23 1 1 1 3 0.250
24 -1 1 1 3 0.750
25 -1 -1 1 3 1.250
26 1 -1 1 3 1.750
27 0 0 -2 4 0.000
28 2 0 0 4 0.000
29 0 2 0 4 0.500
-
shell(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], 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])))} \\ Gives list of all points with Euclidean norm sqrt(n).
A342561_vec=concat([[P[1] | P <- shell(n)] | n<-[0..7]]) \\ M. F. Hasler, Apr 27 2021
A343633
Z-coordinate of the points following the 3D spiral defined in A343630.
Original entry on oeis.org
0, 1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, -2, -2, -2, -2, -3, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, 0
Offset: 0
Cf.
A343643 (variant using the sup norm => square spiral).
Cf.
A342563 (variant which scans each sphere by increasing z).
Cf.
A005875 (number of points on a shell with given radius).
Cf.
A004215 (numbers that can't be written as sum of 3 squares => empty shells).
A343643
Z-coordinate of points following the 3D square spiral defined in A343640.
Original entry on oeis.org
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2
Offset: 0
Cf.
A343633 (variant using the Euclidean norm),
A342563 (another variant).
Cf.
A010014 (number of points on a shell with given radius => row lengths).
A342562
List points (x,y,z) having integer coordinates, sorted first by R=x^2+y^2+z^2 and in case of ties, then by z and last by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives y-coordinates.
Original entry on oeis.org
0, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 1, 1, -1, -1, 0, 1, 0, -1, 1, 1, -1, -1, 1, 1, -1, -1, 0, 0, 2, 0, -2, 0, 0, 1, 0, -1, 0, 2, 0, -2, 1, 2, 2, 1, -1, -2, -2, -1, 0, 2, 0, -2, 0, 1, 0, -1, 1, 1, -1, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 1, -1, -1, 0, 2, 0, -2, 2, 2, -2, -2, 0, 2, 0, -2
Offset: 0
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.
Original entry on oeis.org
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
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.
Cf.
A005875 (number of points on a shell with given radius).
Cf.
A004215 (numbers that can't be written as sum of 3 squares => empty shells).
-
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.
Showing 1-6 of 6 results.
Comments