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

A340171 List of X-coordinates of point moving along one of the arms of a counterclockwise double square spiral; A340172 gives Y-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 30 2020

Keywords

Comments

The odd function f such that f(n) = (a(n), A340172(n)) for any n >= 0 will visit exactly once every lattice point (so it is a bijection from Z to Z^2).

Examples

			The spiral starts as follows:
      +-----+-----+-----+-----+-----+
      .                             |
      .                             |
      .     +-----+-----+-----+     +
      .     |5     4     3    |2    |
      .     |                 |     |
            +     +-----+-----+     +
            |6    |      0     1    |     .
            |     |                 |     .
            +     +-----+-----+-----+     .
            |7                            .
            |                             .
            +-----+-----+-----+-----+-----+
             8     9     10    11    12    13
- so a(0) = a(3) = a(10) = 0,
-    a(1) = a(2) = a(11) = 1.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

abs(a(n+1)-a(n)) + abs(A340172(n+1)-A340172(n)) = 1.
a(n) = A340172(n) iff n belongs to A001105.
a(n) = -A340172(n) iff n belongs to A046092.
a(n) = 2*A340172(n) iff n belongs to A139274.
2*a(n) = A340172(n) iff n belongs to A139275.
a(n) * A340172(n) = 0 iff n belongs to A000217.
a(n) = 0 iff n belongs to A014105.

A340945 List of Y-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340944 gives X-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 30 2021

Keywords

Examples

			The spiral starts as follows:
     +-----+-----+-----+-----+
     |7     6     5     4    |3    .
     |                       |     .
     +     +-----+-----+     +     +
     |8    |           |     |2    |
     |     |           |     |     |
     +     +     +-----+-----+     +
     |9    |     |     |0     1    |
     |     |     |     |           |     .
     +     +     +     +-----+-----+     .
     |10   |     |                       .
     |     |     |                       .
     +     +     +-----+-----+-----+-----+
     .11   .
     .
- so a(0) = a(1) = a(9) = 0,
     a(2) = a(8) = 1,
     a(3) = a(4) = a(5) = a(6) = a(7) = 2,
     a(10) = -1,
     a(11) = -2.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • PARI
    a(n) = my(r,s=sqrtint(n,&r)); if(r>s, s++;r-=2*s-1); imag((r-s*I)*I^s); \\ Kevin Ryde, May 28 2023

Formula

a(n) = 0 iff n = 4*x^2 + 4*x + 1 for some x.
a(n) = Im z where z = (r-s*i)*i^s with s = round(sqrt(n)) = A000194(n) and remainder r = n - s^2. - Kevin Ryde, May 28 2023
Showing 1-2 of 2 results.