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-5 of 5 results.

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])),", "))

A362956 a(n) is the y-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the distance-limited strip bijection described in A307110.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, May 10 2023

Keywords

Crossrefs

A362955 gives the corresponding x-coordinates.

Programs

  • PARI
    \\ for functions ax, ay, p see A362955
    for (k=0, 81, print1 (p(ax(k),ay(k))[2]", "))

A367895 a(n) is the x-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the variant of the distance-limited strip bijection described in A367150.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner and Rainer Rosenthal, Dec 04 2023

Keywords

Crossrefs

A367896 gives the corresponding y-coordinates.

Programs

  • PARI
    \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923.
    \\ It is assumed that the PARI program from A367150 has been loaded and the functions defined there are available.
    ax(n) = {my (m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if (n<0, if (n<-m, k, -k-n), if (n
    				

A367896 a(n) is the y-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the variant of the distance-limited strip bijection described in A367150.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner and Rainer Rosenthal, Dec 04 2023

Keywords

Crossrefs

A367895 gives the corresponding x-coordinates.

Programs

  • PARI
    \\ See A367895 for definitions of required functions.
    a367896(n) = BijectionD([ax(n), ay(n)])[2]

A363760 Cycle lengths obtained by repeated application of Klaus Nagel's strip bijection, as described in A307110.

Original entry on oeis.org

1, 8, 9, 10, 40, 72, 106, 218, 256, 408, 424, 872, 1178, 2336, 2522, 2952, 4712, 10088, 13290, 26648, 28906, 33784, 53160, 115624, 150842, 303784, 330138, 385624, 603368, 1320552, 1716170, 3462216, 3765322, 4397144, 6864680, 15061288, 19543834, 39454792, 42921274, 50118936, 78175336, 171685096
Offset: 1

Views

Author

Hugo Pfoertner, Jun 26 2023

Keywords

Comments

Description provided by Klaus Nagel: (Start)
The strip bijection s (A307110) maps a point P[i,j] from a Z X Z grid to Q[u,v] taken from a second grid obtained from the first one by a rotation by Pi/4 around the origin. The coordinates [i,j] and [u,v] refer to the respective grids. If [u,v] also are considered as coordinates of the first grid, the mapping [i,j] --> [u,v] establishes a permutation of the grid points of Z X Z.
Cycles of this permutation are evaluated; the sequence shows the occurring cycle lengths L.
Q[u,v] is located close to P[i,j]. Changing the reference to the other grid causes a rotation by Pi/4. Hence after eight permutation steps any point should return to the vicinity of its starting position. (End)
Therefore the provided visualizations also include graphs showing only every 8th point for cycles with L divisible by 8.
Examples of cycles with lengths > 10^9 are L = 2536863994 for the starting position [1761546, 1379978], L = 5574310746 for start [5207814, 6746677], and L = 6508768664 for start [7983336, 8380845].

Examples

			a(1) = 1: p(0, 0) -> [0, 0], p(1, 0) -> [1, 0]. Points mapped onto themselves.
a(2) = 8: [0, 1] -> [-1, 1] -> [-2, 0] -> [-1, -1] -> [0, -1] -> [1, -1] -> [2, 0] -> [1, 1] ->  [0, 1].
a(3) = 9: [1, 6] -> [-3, 5] -> [-6, 2] -> [-6, -2] -> [-3, -5] -> [1, -6] -> [5, -4] -> [6, 0] -> [5, 4] -> [1, 6].
a(4) = 10: [0, 2] -> [-1, 2] -> [-2, 1] -> [-2, -1] -> [-1, -2] -> [0, -2] -> [1, -2] -> [2, -1] -> [2, 1] -> [1, 2] -> [0, 2].
List of start points and corresponding cycle lengths:
    y  0   1   2   3   4  5   6   7   8   9  10  11  12  13  14 15 16
   x \---------------------------------------------------------------
   0 | 1   8  10   8   8 40   8   8   8  40   8   8 106   8   8 40  8
   1 | 1   8  10   8   8 40   9  40   8   8 106  40 106   8   8 40  8
   2 | 8  10   8   8   8  8   8   8   8   8  40 106   8   8   8  8 40
   3 | 8   8   8   8  40  9   8   8   8   8   8   8   8 106   8  8  8
   4 | 8   8   8  40   8 40   8   8   8   8   8   8   8   8 106  8  8
   5 | 8  40   8  40   9  8   8   8   8   8   8   8   8   8 106  8  8
   6 | 9  40   9   8   8 40   8  40 106  40 106   8   8   8 106 72  8
   7 | 8   8   8   8   8  8   8   8  40 106   8 106   8 106   8  8 72
   8 |40   8   8   8   8  8  40 106   8 106   8   8   8   8   8  8  8
   9 | 8   8   8   8   8  8 106  40 106   8   8   8   8   8   8  8  8
  10 | 8  40 106   8   8  8   8   8   8   8   8  40   8  40   8  8 72
  11 |40 106  40   8   8  8   8 106   8   8  40   8   8   8  40 72  8
  12 | 8 106   8 106   8  8   8 106   8   8  40   8   8   8  40  8  8
  13 | 8   8   8 106   8  8   8 106   8   8  40   8   8   8  40  8  8
  14 | 8   8   8   8 106  8 106   8   8   8   8  40   8  40   8  8  8
  15 | 8  40   8   8   8  8   8  72   8   8  72   8   8   8   8  8 40
  16 | 8   8  40   8   8  8  72   8   8   8   8  72   8   8   8 40  8
.
a(9) = 256: See links to animated visualizations.
		

Crossrefs

Cf. A367148 (analog of this sequence, but for the triangular lattice).

Programs

  • PARI
    C=cos(Pi/8); S=sin(Pi/8); T=S/C; \\ Global constants
    \\ The mapping function p
    \\ PARI's default precision of 38 digits is sufficient up to abs({x,y})<10^17
    p(i,j) = {my (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};
    \\ cycle length
    cycle(v) = {my (n=1, w=p(v[1],v[2])); while (w!=v, n++; w=p(w[1],w[2])); n};
    a363760 (rmax) = {my (L=List()); for (x=0, rmax, for(y=x, rmax, my(c=cycle([x,y])); if(setsearch(L,c)==0, listput(L,c); listsort(L,1)))); L};
    a363760(500) \\ takes a few minutes, terms up to a(19), check completeness of list with larger rmax
Showing 1-5 of 5 results.