cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 16 results. Next

A307110 Index of matching grid point in the bijection between two infinite quadratic grids with one grid rotated by Pi/4 around the common point (0,0), using an enumeration of the grid points by A305575 and A305576.

Original entry on oeis.org

0, 1, 6, 3, 8, 2, 11, 4, 9, 5, 15, 7, 19, 14, 10, 16, 17, 18, 12, 20, 13, 26, 27, 28, 25, 21, 22, 23, 24, 38, 31, 40, 33, 42, 35, 44, 29, 30, 51, 32, 53, 34, 55, 36, 49, 57, 58, 59, 60, 62, 39, 64, 41, 66, 43, 68, 37, 46, 47, 48, 45, 50, 63, 52, 65, 54, 67
Offset: 0

Views

Author

Hugo Pfoertner, following a proposal by Rainer Rosenthal, Mar 28 2019

Keywords

Comments

In a discussion in the newsgroup de.sci.mathematik, Klaus Nagel (see links) described a bijection P: G -> H between the grid points of two Cartesian grids G{Z X Z} and H{Z X Z} rotated against each other by Pi/4 around the only common point (0,0). This is a variation of the marriage problem asking for a matching in the infinite bipartite graph of the vertices of G U H with small distance d=|P(g)-g| for all points g in G.
Points within the grids are addressed by (i,j) in grid G and by (k,m) in grid H.
The plane is divided into horizontal strips of width cos(Pi/8) = sqrt(sqrt(2)+2)/2, with the x-axis as centerline of strip 0. Grid G is rotated by Pi/8, grid H by -Pi/8.
Assuming proper boundary conditions, there is exactly one grid point of G per grid line i=const and one grid point of grid H per grid line k=const inside each strip.
The intersections of the grid lines i=const from the rotated grid G and of lines k=const from the rotated grid H with the centerline of the strip are determined. The grid points inside the strip are paired such that the distance of the intersection points of lines i=const of grid G and of lines k=const of grid H with the strip centerline is minimized.
This bijection achieves a maximum of all mutual Euclidean distances of all pairs of cos(Pi/8)=0.9238795... (the strip width).
It is conjectured that the least possible maximum distance within pairs can be reduced to sqrt(5)*sin(Pi/8)=0.855706... (A386241), but not further, and that this can be achieved by "local repairs" of the result of the strip bijection, i.e. by reassigning the connections in groups of 4 pairs, one of which being the pair with d>0.8557... and 3 pairs in the vicinity of the violating pair, but potentially addressing points in neighbor strips. The conjecture is supported by extensive numerical results, but an announced proof by Klaus Nagel remained unpublished.
For the current sequence no repair is applied. The first repairs are required beyond i^2+j^2=40. The affected sequence terms for n>=124 are visible in the b-file of A307731.
The results of the matching are shown by enumerating the grid points of grid G according to the sequence pair A305575(n) for i and A305576(n) for j.
After finding the indices of the bijection partners (k,m) in grid H using Klaus Nagel's method, the position L where A305575(L)=k and A305576(L)=m is determined by table lookups, and the unique result is a(n)=L.
The sequence is a permutation of the natural numbers.

Examples

			The following table shows the first few matched pairs of grid points:
    Grid G     Grid H      Grid H rotated
   n  i  j  a(n) k  m  (k,m) rotated by -Pi/4  distance of matched points
   0  0  0    0  0  0    0.000000  0.000000   0.000000
   1  1  0    1  1  0    0.707107 -0.707107   0.765367
   2  0  1    6 -1  1    0.000000  1.414214   0.414214
   3 -1  0    3 -1  0   -0.707107  0.707107   0.765367
   4  0 -1    8  1 -1    0.000000 -1.414214   0.414214
   5  1  1    2  0  1    0.707107  0.707107   0.414214
   6 -1  1   11 -2  0   -1.414214  1.414214   0.585786
   7 -1 -1    4  0 -1   -0.707107 -0.707107   0.414214
   8  1 -1    9  2  0    1.414214 -1.414214   0.585786
   9  2  0    5  1  1    1.414214  0.000000   0.585786
  10  0  2   15 -1  2    0.707107  2.121320   0.717439
  11 -2  0    7 -1 -1   -1.414214  0.000000   0.585786
  12  0 -2   19  1 -2   -0.707107 -2.121320   0.717439
  13  2  1   14  1  2    2.121320  0.707107   0.317025
		

Crossrefs

Programs

  • PARI
    /* It is assumed that the files a305575 and a305576 contain the second column of the corresponding b-files */
    a305575=readvec(a305575); a305576=readvec(a305576);
    p(i,j)={my(C=cos(Pi/8),S=sin(Pi/8),T=S/C,gx=i*C-j*S,gy=i*S+j*C,k,xm,ym,v=[0,0]);
    k=round(gy/C); ym=C*k; xm=gx+(gy-ym)*T;
      v[1]=round((xm-ym*T)*C);  v[2]=round((ym+v[1]*S)/C);  v}
    findpos(v)={for(k=1,#a305575,if(v[1]==a305575[k]&&v[2]==a305576[k],return(k-1)))}
    for(n=1,67,print1(findpos(p(a305575[n],a305576[n])),", "))

A308081 Index positions of the points of a counterclockwise square spiral as described by A174344 and A274923 in a list of points with integer coordinates with primary sorting by radius and secondary sorting by polar angle as given by A305575 and A305576.

Original entry on oeis.org

0, 1, 5, 2, 6, 3, 7, 4, 8, 20, 9, 13, 21, 14, 10, 15, 22, 16, 11, 17, 23, 18, 12, 19, 24, 44, 36, 25, 29, 37, 57, 38, 30, 26, 31, 39, 58, 40, 32, 27, 33, 41, 59, 42, 34, 28, 35, 43, 60, 80, 68, 56, 45, 49, 61, 70, 97, 71, 62, 50, 46, 51, 63, 73, 98, 74, 64
Offset: 1

Views

Author

Hugo Pfoertner, May 11 2019

Keywords

Comments

The sequence is a permutation of the integers.

Crossrefs

Programs

  • PARI
    /* It is assumed that the files a305575 and a305576 contain the second column of the corresponding b-files omitting the initial 0 */
    a305575=readvec(a305575); a305576=readvec(a305576);
    a174344=vector(10000); L=0; d=1; n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, a174344[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, a174344[n++]=j));
    a274923=vector(10100); L=1; d=1; n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, a274923[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, a274923[n++]=j));
    findinring(i, j)={my(s=i*i+j*j);if(s==0,return(0),forstep(k=floor(Pi*(s+1))+sqrtint(s),1,-1,if(i==a305575[k]&&j==a305576[k], return(k))))};
    for(n=1,67,print1(findinring(a174344[n],a274923[n]),", "));

A000328 Number of points of norm <= n^2 in square lattice.

Original entry on oeis.org

1, 5, 13, 29, 49, 81, 113, 149, 197, 253, 317, 377, 441, 529, 613, 709, 797, 901, 1009, 1129, 1257, 1373, 1517, 1653, 1793, 1961, 2121, 2289, 2453, 2629, 2821, 3001, 3209, 3409, 3625, 3853, 4053, 4293, 4513, 4777, 5025, 5261, 5525, 5789, 6077, 6361, 6625
Offset: 0

Views

Author

Keywords

Comments

Number of ordered pairs of integers (x,y) with x^2 + y^2 <= n^2.

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • H. Gupta, A Table of Values of N_3(t), Proc. National Institute of Sciences of India, 13 (1947), 35-63.
  • C. D. Olds, A. Lax and G. P. Davidoff, The Geometry of Numbers, Math. Assoc. Amer., 2000, p. 47.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=2 of A302997.
Equals A051132 + A046109. For another version see A057655.

Programs

  • Haskell
    a000328 n = length [(x,y) | x <- [-n..n], y <- [-n..n], x^2 + y^2 <= n^2]
    -- Reinhard Zumkeller, Jan 23 2012
    
  • Mathematica
    Table[Sum[SquaresR[2, k], {k, 0, n^2}], {n, 0, 46}]
  • PARI
    { a(n) = 1 + 4 * sum(j=0,n^2\4, n^2\(4*j+1) - n^2\(4*j+3) ) } /* Max Alekseyev, Nov 18 2007 */
    
  • Python
    def A000328(n):
        return (sum([int((n**2 - y**2)**0.5) for y in range(1, n)]) * 4 + 4*n + 1)
        # Karl-Heinz Hofmann, Aug 03 2022
    
  • Python
    from math import isqrt
    def A000328(n): return 1+(sum(isqrt(k*((n<<1)-k)) for k in range(1,n+1))<<2) # Chai Wah Wu, Feb 12 2025

Formula

a(n) = 1 + 4 * Sum_{j>=0} floor(n^2/(4*j+1)) - floor(n^2/(4*j+3)). Also a(n) = A057655(n^2). - Max Alekseyev, Nov 18 2007
a(n) = 4*A000603(n) - (4*n+3), n >= 0. - Wolfdieter Lang, Mar 15 2015
a(n) = 1+4*n^2-4*ceiling((n-1)/sqrt(2))-8*A247588(n-1), n>1. - Mats Granvik, May 23 2015
a(n) = [x^(n^2)] theta_3(x)^2/(1 - x), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 14 2018
Limit_{n->oo} a(n)/n^2 = Pi. - Chai Wah Wu, Feb 12 2025

Extensions

More terms from David W. Wilson, May 22 2000
Edited at the suggestion of Max Alekseyev by N. J. A. Sloane, Nov 18 2007
Incorrect comment removed by Eric M. Schmidt, May 28 2015

A367150 Results of the strip bijection as described in A307110 with subsequent reassignment of the pair connections at all locations, in which 4 points of a unit square in one grid are mapped to a unit square in the other (rotated by Pi/4) grid in such a way that the maximum distance of the two points in the 4 assigned pairs is minimized.

Original entry on oeis.org

0, 5, 6, 7, 8, 2, 3, 4, 1, 13, 15, 17, 19, 14, 10, 16, 11, 18, 12, 20, 9, 26, 27, 28, 25, 21, 22, 23, 24, 38, 39, 40, 41, 42, 43, 44, 37, 30, 31, 32, 33, 34, 35, 36, 29, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 61, 46, 47, 48, 45, 50, 51, 52, 53, 54, 55
Offset: 0

Views

Author

Rainer Rosenthal and Hugo Pfoertner, Nov 22 2023

Keywords

Comments

The strip bijection of A307110 assigns each grid point in one grid to a unique grid point in the rotated grid. The mapping therefore corresponds to a permutation of the nonnegative integers. Approximately 2/3 of the grid points are mapped in such a way that 4 points that form a unit square in the original grid also form a unit square after being mapped onto the rotated grid. We call this a stable (grid) cell under the bijection map. The method differs from that used in A307731 in that for each stable cell it is tried whether the maximum of the 4 pair distances resulting from the application of strip bijection can be reduced by a cyclic rotation of the connections. The one of the two assignments by cyclic connection change is selected that provides a smaller maximum of the 4 distances in the pairs assigned to each other. In contrast, a cyclic rotation of the connections is only carried out in the method of A307731 if the maximum of the 4 distances exceeds the upper limit of the bijection distance of sqrt(5)*sin(Pi/8)=0.855706... .

Examples

			   n   i = A305575(n)
   |   |   j = A305576(n)
   |   |   |   A307110(n)
   |   |   |   |  k   m  distance_A307110
   |   |   |   |  |   |    |      a(n)  k'  m' distance after
   |   |   |   |  |   |    |        |   |   |  reconnecting
   0   0   0   0  0   0  0.0000     0   0   0   0.0000
   1   1   0   1  1   0  0.7654 L   5   1   1   0.4142  r
   2   0   1   6 -1   1  0.4142     6  -1   1   0.4142
   3  -1   0   3 -1   0  0.7654 L   7  -1  -1   0.4142  r
   4   0  -1   8  1  -1  0.4142     8   1  -1   0.4142
   5   1   1   2  0   1  0.4142     2   0   1   0.4142
   6  -1   1  11 -2   0  0.5858     3  -1   0   0.4142  r
   7  -1  -1   4  0  -1  0.4142     4   0  -1   0.4142
   8   1  -1   9  2   0  0.5858     1   1   0   0.4142  r
   9   2   0   5  1   1  0.5858    13   2   1   0.7174  r
  10   0   2  15 -1   2  0.7174    15  -1   2   0.7174
  11  -2   0   7 -1  -1  0.5858    17  -2  -1   0.7174  r
  13   2   1                improved by reconnecting
  15  -1   2         L = 0.7654      ->         0.7174
  17  -2  -1
See the linked file for a visualization of the differences from A307110.
		

Crossrefs

Cf. A305575, A305576 (enumeration of the grid points in the square lattice).

Programs

  • PARI
    \\ See Pfoertner link.

A305576 List points (x,y) having integer coordinates, sorted first by radial coordinate r and in case of ties, by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives y-coordinates.

Original entry on oeis.org

0, 0, 1, 0, -1, 1, 1, -1, -1, 0, 2, 0, -2, 1, 2, 2, 1, -1, -2, -2, -1, 2, 2, -2, -2, 0, 3, 0, -3, 1, 3, 3, 1, -1, -3, -3, -1, 2, 3, 3, 2, -2, -3, -3, -2, 0, 4, 0, -4, 1, 4, 4, 1, -1, -4, -4, -1, 3, 3, -3, -3, 2, 4, 4, 2, -2, -4, -4, -2, 0, 3, 4, 5, 4, 3, 0, -3, -4, -5, -4, -3, 1
Offset: 0

Views

Author

Hugo Pfoertner, Jun 05 2018

Keywords

Comments

Similar to A283308, but with secondary sorting by polar angle.

Examples

			See A305575.
		

Crossrefs

For the x-coordinates see A305575.

Programs

A307014 List coordinates (x,y) of the points in an hexagonal grid, sorted first by radial coordinate r and in case of ties, by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives the first coordinate in a barycentric coordinate system.

Original entry on oeis.org

0, 1, 0, -1, -1, 0, 1, 1, -1, -2, -1, 1, 2, 2, 0, -2, -2, 0, 2, 2, 1, -1, -2, -3, -3, -2, -1, 1, 2, 3, 3, 3, 0, -3, -3, 0, 3, 2, -2, -4, -2, 2, 4, 3, 1, -1, -3, -4, -4, -3, -1, 1, 3, 4, 4, 4, 0, -4, -4, 0, 4, 3, 2, -2, -3, -5, -5, -3, -2, 2, 3, 5, 5, 4, 1
Offset: 0

Views

Author

Hugo Pfoertner, Mar 21 2019

Keywords

Comments

Cartesian coordinates (x,y) of the grid points are converted to barycentric coordinates (i,j,k) by i = x - y/sqrt(3), j = 2*y/sqrt(3), k = x + y/sqrt(3). The sequence gives i. j is given in A307016, k is given in A307017.
The sorting by polar angle affects the grid points in the shells of size A035019, starting at indices given by A038590.

Crossrefs

Programs

  • PARI
    \\ See Link
    \\ To create the data of this sequence load program from file and call
    a307014_16(5, 4) \\ Hugo Pfoertner, Nov 07 2023

A283308 List points (x,y) having integer coordinates, sorted first by x^2+y^2 and in case of ties, by x-coordinate and then by y-coordinate. Sequence gives y-coordinates.

Original entry on oeis.org

0, 0, -1, 1, 0, -1, 1, -1, 1, 0, -2, 2, 0, -1, 1, -2, 2, -2, 2, -1, 1, -2, 2, -2, 2, 0, -3, 3, 0, -1, 1, -3, 3, -3, 3, -1, 1, -2, 2, -3, 3, -3, 3, -2, 2, 0, -4, 4, 0, -1, 1, -4, 4, -4, 4, -1, 1, -3, 3, -3, 3, -2, 2, -4, 4, -4, 4, -2, 2, 0, -3, 3, -4, 4, -5, 5, -4, 4, -3, 3, 0, -1, 1, -5, 5, -5, 5
Offset: 1

Views

Author

N. J. A. Sloane, Mar 04 2017, following a suggestion from Ahmet Arduç

Keywords

Examples

			The first few points (listing [x^2+y^2,x,y]) are: [0, 0, 0], [1, -1, 0], [1, 0, -1], [1, 0, 1], [1, 1, 0], [2, -1, -1], [2, -1, 1], [2, 1, -1], [2, 1, 1], [4, -2, 0], [4, 0, -2], [4, 0, 2], [4, 2, 0], [5, -2, -1], [5, -2, 1], [5, -1, -2], [5, -1, 2], [5, 1, -2], [5, 1, 2], [5, 2, -1], [5, 2, 1], [8, -2, -2], [8, -2, 2], [8, 2, -2], ...
		

Crossrefs

For the x coordinates see A283307.

Programs

  • Maple
    L:=[];
    M:=30;
    for i from -M to M do
    for j from -M to M do
    L:=[op(L),[i^2+j^2,i,j]]; od: od:
    t6:= sort(L,proc(a,b) evalb(a[1]<=b[1]); end);
    t6x:=[seq(t6[i][2],i=1..100)]; # A283307
    t6y:=[seq(t6[i][3],i=1..100)]; # A283308
  • PARI
    rs(t)=round(sqrt(abs(t)));pt(t)=print1(rs(t)*sign(t),", ");for(r2=0,26,xm=rs(r2);for(x=-xm,xm,y2=r2-x^2;if(issquare(y2),if(y2==0,pt(0),pt(-y2);pt(y2))))) \\ Hugo Pfoertner, Jun 18 2018

A307731 Results of strip bijection as described in A307110 with additional application of local repairs to reduce the maximum wobbling distance S from S1=cos(Pi/8) to S2=sqrt(5)*sin(Pi/8).

Original entry on oeis.org

0, 1, 6, 3, 8, 2, 11, 4, 9, 5, 15, 7, 19, 14, 10, 16, 17, 18, 12, 20, 13, 26, 27, 28, 25, 21, 22, 23, 24, 38, 31, 40, 33, 42, 35, 44, 29, 30, 51, 32, 53, 34, 55, 36, 49, 57, 58, 59, 60, 62, 39, 64, 41, 66, 43, 68, 37, 46, 47, 48, 45, 50, 63, 52, 65, 54, 67
Offset: 0

Views

Author

Hugo Pfoertner, Apr 25 2019

Keywords

Comments

The terms visible in the data section are identical with those of A307110. The first difference occurs at a(124)=141, A307110(124)=125.
The wobbling distance S is the mutual Euclidean distance of the pairs matched by a bijection.
.
- - - G - -\- - - - - - / - G - - - - -\- - - - - G -/- - - - - - - - - G
| + \ / | \ +|/ |
| + \ / | \ + | |
| H | H | |
| / \ | / \ | |
| / \ . . . / |\ |
| / . \ | / . | \ /|
|/ \ | / . | \ / |
/| . \| / . | \ / |
/ | |\ / .| \ / |
H + | . | +H # # # # . H + + |
- \ + G - - - - - - - - - - G+ -\- - - - # # # # #G.- - - - - - -\- -+ +G
\ | . #| \ \ +| . / \ |
\ # | D \ +| / \ |
| \ . # | \ \ +| / \
| \ <--------r=S1------C \ + | ./ |
| \ # | B \ + | / |
| . # | B \ + / |
| .H+ | B H |. |
| / \++ | B / #. |
| / . \++ | B / #| \ |
| / . \+++ | B / . # \ |
- - - G / - - - - - . - \ -+G - - - - -B/ - - . +G - - \ - - - - - - - G
+ / . \ |# / B +E+. | . \ + /
+/ | . # /. +M+ | . \ + / |
+/ | | \# / +E+ b | .\ +/ |
H | | H+ . b | .H |
\ | | / .\ b | / .\ |
\ | / . \ b | / . \ |
\ / | . \ b | / \ |
| \ / | . \ b | / . \
| \ / |. \ b | / |
| \ / |. \ c--------r=S1------>. |
- - - G+++++- \ - / - - - - G.- - - - - - - - - HdG - - - - - - - - -.- G
| ++++H +. / \ . |
| / \ |+ / | \ |
| / \ |+. / | \ . |
| / \ | + / | \ . /
|/ \ | + . / | \ . / |
/ \ + . / | \ . / |
/ | | \ + . | . / |
H | | H . | . H |
\ | | / \ . | . / + |
\ | / \ . / + |
- - - G - - - - - - - - - / G - - - - -\- - - - - G - - - / - - - - - - G
.
The ASCII graphics above shows the situation after the application of the strip bijection, as it is described in A307110, for a position in the grids containing a "long" junction exceeding the length S2. The linked graphics file "Construction of repair" shows a similar configuration, but without labels.
All junctions resulting from the strip bijection are marked by plus signs. The long junction is marked by embedded letters "E". There are 6 possible orientations of E-junctions (called E for short), but the method for their elimination is identical for all cases.
The target of the method is to achieve a local reconnecting, which replaces 4 junctions by circularly shifted new junctions. To determine the affected grid points, the following steps are performed:
From the midpoint (marked by M in the figure) of E construct a bisecting line Bb perpendicular to E. Draw two circles, one on each side of E with centers on B and b at distance S1 from M. E is a tangent at M of these circles with radius r = S1. The two circles are marked by dots ".." in the figure.
For the two circle centers C and c determine the distances D and d of the respective closest grid points in lattice G. The position (c) of the circle center, for which this minimum distance is smaller, indicates on which side of E no reconnecting is required. A circle with radius S1 around c contains only one grid point of G and one of H. All other grid points of both lattices lie outside of this circle.
The side of E with the larger distance between circle center and closest grid point is where the circular shift of junctions is to be performed. The circle around C with radius r = S1 contains 3 grid points of lattice G and 3 grid points of lattice H.
After having found c, it is possible to replace the geometric determination of the 3 grid point pairs on the opposite side of E by a lookup in a table of differences between the coordinates of M and c rounded to nearest integers, leading to a unique identification of the 6 occurring cases. The function "repair" in the PARI program implements this selection.
The 4 new junctions are marked by "###" in the figure. They replace the 4 previous "+++" junctions, including the long junction E. The maximum of their lengths does not exceed S2, approaching S2 for length of E approaching S1. The limiting case for the 4 rearranged junctions are two of length S2 and two of length sin(Pi/8) = 0.38268...
The described repair is applied to all occurrences of bijection distances exceeding S2 within the overlay of the two lattices. Numerical experiments with random points on square lattices of huge size show that approximately 0.956 % (roughly 1/105) of the grid points lead to a bijection distance S > S2 after the application of the strip bijection. No counterexample for the validity of the method is known, but a formal proof is missing.
In the ring-wise one-dimensional mapping of the bijection as given by A307110, the first affected position is n = 124. The table in the example section shows the corresponding changes for this earliest repair together with the listing of another repair with different orientation of E.
All affected index positions have to be exchanged in the one-dimensional list. Due to the occurrence frequency of E-junctions the current sequence is expected to differ from A307110 for roughly 4% of the terms.
The PARI program provided as external file is self-contained, including the code for generation of the rings used for 1d-mapping, A305575 and A305576, and the code for the strip bijection of A307110. To generate a b-file of 10000 terms, the corresponding code lines at the end of the program have to be activated.

Examples

			The table shows the first re-matched pairs of grid points together with the result of the unmodified strip bijection:
    Grid G          Grid H             Grid H rotated
   n     i    j    a(n)   k    m   (k,m) rotated by -Pi/4  distance of
                                                           matched points
  124   -6    2    141   -6   -3    -6.363961   2.121320   0.383648
  140   -6    3    125   -6   -2    -5.656854   2.828427   0.383649
  180   -7    3    173   -7   -2    -6.363961   3.535534   0.831470 < S2
  172   -7    2    181   -7   -3    -7.071068   2.828427   0.831470 < S2
  ...
  266   -6    7    256   -9    1    -5.656854   7.071068   0.350428
  309   -6    8    320  -10    1    -6.363961   7.778174   0.426232
  279   -5    8    328  -10    2    -5.656854   8.485281   0.816673 < S2
  235   -5    7    268   -9    2    -4.949747   7.778174   0.779795 < S2
compared to (unmodified):                                        S2=0.855706..
                A307110(n)
  124   -6    2    125   -6   -2    -5.656854   2.828427   0.896683 > S2
  140   -6    3    173   -7   -2    -6.363961   3.535534   0.647506
  180   -7    3    181   -7   -3    -7.071068   2.828427   0.185709
  172   -7    2    141   -6   -3    -6.363961   2.121320   0.647506
  ...
  266   -6    7    320  -10    1    -6.363961   7.778174   0.859083 > S2
  309   -6    8    328  -10    2    -5.656854   8.485281   0.594346
  279   -5    8    268   -9    2    -4.949747   7.778174   0.227446
  235   -5    7    256   -9    1    -5.656854   7.071068   0.660688
		

Crossrefs

Programs

  • PARI
    \\ See Pfoertner link.

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

Views

Author

Hugo Pfoertner, Apr 27 2021

Keywords

Comments

This is a 3-dimensional generalization of A305575 and A305576.
y-coordinates are in A342562, z-coordinates are in A342563.
These lists can be read as an irregular table, where row r lists the respective coordinates of the points on the sphere with radius R = sqrt(r); their number (i.e., the row length) is given by A005875 = (1, 6, 12, 8, 6, 24, 24, 0, 12, 30, ...). - M. F. Hasler, Apr 27 2021

Examples

			   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
		

Crossrefs

Cf. A343630, A340631, A340632, A343633 for a variant which "connects" corresponding poles of successive shells, A343640, A340641, A340642, A343643 for a square spiral variant.

Programs

  • PARI
    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

A342563 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 z-coordinates.

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
Offset: 0

Views

Author

Hugo Pfoertner, Apr 27 2021

Keywords

Examples

			See A342561.
		

Crossrefs

Cf. A305575, A305576, A342561 (x-coordinates), A342562 (y-coordinates).

Programs

Showing 1-10 of 16 results. Next