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

A305575 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 x-coordinates.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Jun 05 2018

Keywords

Comments

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

Examples

			The first points (listing [polar angle phi,x,y]) are:
r^2
  0: [0.0*Pi,0,0];
  1: [0.0*Pi,1,0], [0.5*Pi,0,1], [1.0*Pi,-1,0], [1.5*Pi,0,-1];
  2: [0.25*Pi,1,1], [0.75*Pi,-1,1], [1.25*Pi,-1,-1], [1.75*Pi,1,-1];
  4: [0.0*Pi,2,0], [0.5*Pi,0,2], [1.0*Pi,-2,0], [1.5*Pi,0,-2];
  5: [0.148*Pi,2,1], [0.352*Pi,1,2], [0.648*Pi,-1,2], [0.852*Pi,-2,1],
   [1.148*Pi,-2,-1], [1.352*Pi,-1,-2], [1.648*Pi,1,-2], [1.852*Pi,2,-1];
  8: [0.25*Pi,2,2], [0.75*Pi,-2,2], [1.25*Pi,-2,-2], [1.75*Pi,2,-2].
		

Crossrefs

For the y-coordinates see A305576.

Programs

  • PARI
    atan2(y,x)=if(x>0,atan(y/x),if(x==0,if(y>0,Pi/2,-Pi/2),if(y>=0,atan(y/x)+Pi,atan(y/x)-Pi)));
    angle(x,y)=(atan2(y,x)+2*Pi)%(2*Pi);
    {a004018(n) = if( n<1, n==0, 4 * sumdiv( n, d, (d%4==1) - (d%4==3)))};
    xyselect=1; \\ change to 2 for A305576
    print1(0,", ");for(s=1,25,my(r=a004018(s));if(r>0,my(v=matrix(r,3),w=vector(r),m=sqrtint(s),L=0);for(i=-m,m,my(k=s-i^2,kk);if(k==0,v[L++,1]=i;v[L,2]=0;v[L,3]=angle(i,0),if(issquare(k),kk=sqrtint(k);forstep(j=-kk,kk,kk+kk,v[L++,1]=i;v[L,2]=j;v[L,3]=angle(i,j)))));p=vecsort(v[,3],,1);for(k=1,L,w[k]=v[p[k],xyselect]);for(k=1,L,print1(w[k],", ")))); \\ Hugo Pfoertner, May 12 2019

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

A308080 Index positions of the points with integer coordinates with primary sorting by radius and secondary sorting by polar angle in the counterclockwise square spiral described by A174344 and A274923.

Original entry on oeis.org

1, 2, 4, 6, 8, 3, 5, 7, 9, 11, 15, 19, 23, 12, 14, 16, 18, 20, 22, 24, 10, 13, 17, 21, 25, 28, 34, 40, 46, 29, 33, 35, 39, 41, 45, 47, 27, 30, 32, 36, 38, 42, 44, 48, 26, 53, 61, 69, 77, 54, 60, 62, 68, 70, 76, 78, 52, 31, 37, 43, 49, 55, 59, 63, 67, 71, 75, 79
Offset: 0

Views

Author

Hugo Pfoertner, May 11 2019

Keywords

Comments

The lists of the ring-wise sorted points is provided in A305575 for x and A305576 for y.
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));
    findinspiral(i, j)={my(size=(2*max(abs(i), abs(j))+1)^2); forstep(k=size, 1, -1, if(i==a174344[k]&&j==a274923[k], return(k)))};
    print1(findinspiral(0,0),", ");for(n=1,67,print1(findinspiral(a305575[n],a305576[n]),", "));
Showing 1-3 of 3 results.