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.

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

Original entry on oeis.org

0, -1, 0, 0, 1, -1, -1, 1, 1, -2, 0, 0, 2, -2, -2, -1, -1, 1, 1, 2, 2, -2, -2, 2, 2, -3, 0, 0, 3, -3, -3, -1, -1, 1, 1, 3, 3, -3, -3, -2, -2, 2, 2, 3, 3, -4, 0, 0, 4, -4, -4, -1, -1, 1, 1, 4, 4, -3, -3, 3, 3, -4, -4, -2, -2, 2, 2, 4, 4, -5, -4, -4, -3, -3, 0, 0, 3, 3, 4, 4, 5, -5, -5, -1, -1, 1
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 y coordinates see A283308.

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
    pt(t)=print1(t,", ");for(r2=0,26,xm=round(sqrt(r2));for(x=-xm,xm,y2=r2-x^2;if(issquare(y2),if(y2!=0,pt(x));pt(x)))) \\ Hugo Pfoertner, Jun 18 2018