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-4 of 4 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

A283305 List points (x,y) having integer coordinates with x >= 0, y >= 0, sorted first by x^2+y^2 and in case of a tie, by x-coordinate. Sequence gives x-coordinates.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 3, 1, 3, 2, 3, 0, 4, 1, 4, 3, 2, 4, 0, 3, 4, 5, 1, 5, 2, 5, 4, 3, 5, 0, 6, 1, 6, 2, 6, 4, 5, 3, 6, 0, 7, 1, 5, 7, 4, 6, 2, 7, 3, 7, 5, 6, 0, 8, 1, 4, 7, 8, 2, 8, 6, 3, 8, 5, 7, 4, 8, 0, 9, 1, 9, 2, 6, 7, 9, 5, 8, 3, 9, 4, 9, 7, 0, 6, 8, 10, 1, 10, 2, 10, 5, 9, 3, 10, 7, 8
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, 0, 1], [1, 1, 0], [2, 1, 1], [4, 0, 2], [4, 2, 0], [5, 1, 2], [5, 2, 1], [8, 2, 2], [9, 0, 3], [9, 3, 0], [10, 1, 3], [10, 3, 1], [13, 2, 3], [13, 3, 2], [16, 0, 4], [16, 4, 0], [17, 1, 4], [17, 4, 1], [18, 3, 3], [20, 2, 4], [20, 4, 2], [25, 0, 5], [25, 3, 4], [25, 4, 3], ...
		

Crossrefs

For the y coordinates see A283306.

Programs

  • Maple
    L:=[];
    M:=30;
    for i from 0 to M do
    for j from 0 to M do
    L:=[op(L),[i^2+j^2,i,j]]; od: od:
    t4:= sort(L,proc(a,b) evalb(a[1]<=b[1]); end);
    t4x:=[seq(t4[i][2],i=1..100)]; # A283305
    t4y:=[seq(t4[i][3],i=1..100)]; # A283306
  • Mathematica
    nt = 105; (* number of terms to produce *)
    S[m_] := S[m] = Table[{x, y}, {x, 0, m}, {y, 0, m}] // Flatten[#, 1]& // SortBy[#, {#.#&, #[[1]]&}]& // #[[All, 1]]& // PadRight[#, nt]&;
    S[m = 2];
    S[m = 2m];
    While[S[m] =!= S[m/2], m = 2m];
    S[m] (* Jean-François Alcover, Mar 05 2023 *)
  • PARI
    for(r2=0,113,for(x=0,round(sqrt(r2)),y2=r2-x^2;if(issquare(y2),print1(x,", ")))) \\ Hugo Pfoertner, Jun 18 2018

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
Showing 1-4 of 4 results.