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.

Previous Showing 41-50 of 81 results. Next

A358278 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to the smallest numbered unvisited square and where the square is on a different square ring of numbers than the current square.

Original entry on oeis.org

1, 10, 3, 16, 33, 4, 11, 8, 19, 38, 5, 14, 29, 2, 13, 28, 9, 12, 27, 24, 7, 18, 35, 60, 15, 6, 17, 34, 59, 30, 53, 26, 79, 46, 21, 40, 67, 36, 61, 32, 55, 86, 51, 48, 23, 44, 71, 20, 39, 66, 99, 62, 37, 68, 41, 22, 43, 70, 105, 148, 65, 98, 139, 94, 31, 54, 85, 50, 25, 52, 49, 78, 45, 74
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Nov 08 2022

Keywords

Comments

This sequence is finite: after 1455 squares have been visited the square with number 1345 is reached after which all eight neighboring squares the knight could move to have already been visited. See the linked image. The largest visited square is a(1374) = 1996 while the smallest unvisited square is 1024.

Examples

			The board is numbered using a square spiral. The square rings of numbers are shown below:
.
    17--16--15--14--13   .
     |               |   .
    18   5---4---3  12  29
     |   |       |   |   |
    19   6   1   2  11  28
     |   |       |   |   |
    20   7---8---9  10  27
     |               |   |
    21--22--23--24--25  26
                         |
   -44--45--46--47--48--49
.
a(4) = 16 as after the knight moves to the square containing a(3) = 3 the available unvisited squares are 6, 8, 16, 28, 30, 32, 34. Of these 6 and 8 are the smallest but both of them lie on the first square ring of numbers, the same as the current number 3. Of the remaining squares the smallest unvisited square is 16. This is the first term to differ from A316667.
		

Crossrefs

A308412 Indices of Gaussian primes on a square spiral.

Original entry on oeis.org

3, 5, 7, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 52, 54, 60, 62, 68, 70, 76, 78, 82, 84, 88, 90, 92, 94, 98, 100, 102, 104, 108, 110, 112, 114, 118, 120, 122, 126, 128, 132, 134, 138, 140, 144, 146, 150, 152, 156, 158
Offset: 1

Views

Author

Rémy Sigrist, Jun 01 2019

Keywords

Comments

These are the numbers k > 0 such that A174344(k) + i*A274923(k) is a Gaussian prime (where i denotes the imaginary unit).
For symmetry reasons, we obtain the same sequence when considering a clockwise or a counterclockwise square spiral, or when initially moving towards any unit direction.
All terms except the first four are even.

Examples

			The first terms displayed on the center of a counterclockwise square spiral are:
  y\x|    -5   -4   -3   -2   -1    0   +1   +2   +3   +4   +5
  ---+--------------------------------------------------------
   +5|     *--100----*---98----*----*----*---94----*---92----*
     |     |                                                 |
   +4|   102    *----*----*---62----*---60----*----*----*   90
     |     |    |                                       |    |
   +3|     *    *    *---36----*---34----*---32----*    *    *
     |     |    |    |                             |    |    |
   +2|   104    *   38    *---16----*---14----*   30    *   88
     |     |    |    |    |                   |    |    |    |
   +1|     *   68    *   18    5----*----3   12    *   54    *
     |     |    |    |    |    |         |    |    |    |    |
    0|     *    *   40    *    *    *----*    *   28    *    *
     |     |    |    |    |    |              |    |    |    |
   -1|     *   70    *   20    7----*----9---10    *   52    *
     |     |    |    |    |                        |    |    |
   -2|   108    *   42    *---22----*---24----*---26    *   84
     |     |    |    |                                  |    |
   -3|     *    *    *---44----*---46----*---48----*----*    *
     |     |    |                                            |
    4|   110    *----*----*---76----*---78----*----*----*---82
     |     |
    5|     *--112----*--114----*----*----*--118----*--120----*
		

Crossrefs

Programs

  • Maple
    SP:= proc(n) option remember; local k;
    k:=floor(sqrt(4*n-7)) mod 4;
    procname(n-1) -I*exp(I*k*Pi/2)
    end proc:
    SP(1):= 0:
    select(i -> GaussInt:-GIprime(SP(i)), [$1..1000]); # Robert Israel, May 20 2024
  • PARI
    \\ See Links section.

A333825 Lexicographically earliest sequence of distinct positive integers, which when mapped onto a square spiral, gives a set without three distinct aligned points.

Original entry on oeis.org

1, 2, 3, 4, 17, 20, 22, 27, 45, 48, 67, 79, 80, 131, 135, 174, 180, 194, 201, 209, 236, 254, 312, 319, 394, 523, 644, 656, 706, 711, 733, 765, 766, 845, 848, 921, 922, 935, 1034, 1051, 1219, 1292, 1310, 1330, 1399, 1410, 1546, 1589, 1674, 1792, 1816, 1863
Offset: 1

Views

Author

Rémy Sigrist, Apr 07 2020

Keywords

Comments

This sequence has similarities with A236266.

Examples

			The first terms, mapped onto a square spiral, are:
         *---*---*---*---*---*---*---*---*
         |                               |
         *   *---*---*---*---*---*---*   *
         |   |                       |   |
        67   *  17---*---*---*---*   *   *
         |   |   |               |   |   |
         *   *   *   *---4---3   *   *   *
         |   |   |   |       |   |   |   |
         *   *   *   *   1---2   *   *   *
         |   |   |   |           |   |   |
         *   *  20   *---*---*---*  27   *
         |   |   |                   |   |
         *   *   *--22---*---*---*---*   *
         |   |                           |
         *   *---*--45---*---*--48---*---*
         |
         *---*---*---*---*---*--79--80---*
		

Crossrefs

See A333835 and A333866 for a similar sequences.

A334741 Fill an infinite square array by following a spiral around the origin; in the central cell enter a(0)=1; thereafter, in the n-th cell, enter the sum of the entries of those earlier cells that are in the same row or column as that cell.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 11, 21, 40, 47, 93, 180, 203, 397, 796, 1576, 1675, 3305, 6636, 13192, 14004, 27607, 55029, 110192, 220024, 226740, 450123, 898661, 1798700, 3594248, 3704800, 7354303, 14681369, 29349536, 58710640, 117394896, 119196748, 237492079
Offset: 0

Views

Author

Alec Jones and Peter Kagey, May 09 2020

Keywords

Comments

The spiral track being used here is the same as in A274640, except that the starting cell here is indexed 0 (as in A274641).
The central cell gets index 0 (and we fill it in with the value a(0)=1).

Examples

			Spiral begins:
     3----2----1
     |         |
     5    1----1   47
     |              |
     8---11---21---40
a(11) = 47 = 1 + 1 + 5 + 40, the sum of the cells in its row and column.
		

Crossrefs

Cf. A280027.
x- and y-coordinates are given by A174344 and A274923, respectively.

Programs

  • PARI
    \\ here P(n) returns A174344 and A274923 as pair.
    P(n)={my(m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if(n<0, if(n<-m, [k, 3*k+n], [-k-n, k]), if(nAndrew Howroyd, May 09 2020

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.

A341278 The smallest spiral number not covered by any square in the minimal-sum square spiral tiling by n X n squares in A341363.

Original entry on oeis.org

67, 173, 25, 30, 42, 56, 72, 90, 110, 132, 156, 182, 209, 239, 271, 305, 341, 379, 419, 461, 505, 551, 599, 649, 701, 755, 810, 860, 928, 990, 1054, 1120, 1188, 1258, 1330, 1404, 1480, 1558, 1638, 1720, 1804, 1890, 1978, 2067, 2159, 2253, 2349, 2447, 2547, 2649, 2753, 2859, 2967, 3077, 3189
Offset: 2

Views

Author

Scott R. Shannon, Feb 08 2021

Keywords

Comments

The tilings with n=2 and n=3 are the only ones where the smallest uncovered square is not adjacent to the first centrally placed tile. The sequence starts at n=2 as a 1 X 1 square tiling leaves no squares uncovered.
See A341363 for other images with higher numbers of placed tiles.

Crossrefs

A341363 Table read by antidiagonals: T(n, k) is the sum of the numbers inside the k-th square of size n X n when the square spiral is tiled with these squares, where each tile contains numbers which sum to the minimum possible value, and each number on the spiral can only be in one tile.

Original entry on oeis.org

1, 2, 10, 3, 48, 45, 4, 60, 276, 136, 5, 68, 321, 928, 325, 6, 80, 368, 1040, 2349, 666, 7, 92, 384, 1168, 2575, 4984, 1225, 8, 100, 429, 1296, 2825, 5382, 9391, 2080, 9, 124, 456, 1388, 3075, 5816, 10030, 16228, 3321, 10, 128, 554, 1656, 3627, 6250, 10718, 17190, 26257, 5050
Offset: 1

Views

Author

Scott R. Shannon, Feb 10 2021

Keywords

Comments

The terms for a given n tend to have larger jumps in value at one more than the square of the odd numbers, i.e., at k = (2*t+1)^2 + 1, t >= 0, due to the previous square filling a grid of squares containing (2*t+1)^2 squares. This forces the next square to move further away from the origin and into spiral arms containing larger numbers.
See A341278 for the smallest spiral number not covered by any square in each n X n tiling.

Examples

			The table begins:
     1,     2,     3,     4,     5,     6,     7,     8,     9,     10, ...
    10,    48,    60,    68,    80,    92,   100,   124,   128,    156, ...
    45,   276,   321,   368,   384,   429,   456,   554,   702,    803, ...
   136,   928,  1040,  1168,  1296,  1388,  1656,  1696,  1858,   2876, ...
   325,  2349,  2575,  2825,  3075,  3627,  3935,  4243,  4415,   7740, ...
   666,  4984,  5382,  5816,  6250,  8456,  9188,  9576, 10154,  14204, ...
  1225,  9391, 10030, 10718, 11406, 15006, 16260, 16737, 17627,  27701, ...
  2080, 16228, 17190, 18216, 19242, 24856, 26856, 27392, 28692,  49240, ...
  3321, 26257, 27636, 29096, 30556, 38998, 42010, 42561, 44383,  81527, ...
  5050, 40344, 42246, 44248, 46250, 58560, 62892, 63400, 65870, 127660, ...
  7381, 59459, 62002, 64666, 67330, 84806, 90808, 91201, 94459, 191129, ...
  ...
.
a(2,1) = 10 as the first square of size 2 X 2 is placed such that it covers the numbers 1,2,3,4, which sum to 10. This is the minimum possible sum.
a(2,2) = 48 as the second square of size 2 X 2 is placed such that it covers the numbers 5,6,18,19, which sum to 48. This is the minimum possible sum for such a square which does not use the previously covered numbers 1,2,3,4.
a(2,3) = 60 as the third square of size 2 X 2 is placed such that it covers the numbers 7,8,22,23, which sum to 60. This is the minimum possible sum for such a square which does not use the previously covered numbers 1,2,3,4,5,6,18,19.
		

Crossrefs

Formula

T(1,k) = k.
T(n,1) = n^2*(n^2+1)/2 = A000217(n^2).

A361486 Lexicographically earliest sequence of positive numbers on a square spiral such that no three equal numbers are collinear.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 1, 3, 3, 1, 4, 1, 4, 3, 5, 5, 1, 4, 3, 4, 5, 4, 4, 5, 6, 6, 7, 4, 4, 5, 5, 6, 2, 4, 1, 4, 5, 1, 6, 2, 6, 4, 6, 5, 5, 7, 2, 3, 4, 6, 5, 5, 7, 2, 3, 8, 1, 4, 3, 6, 7, 5, 5, 3, 5, 7, 6, 3, 1, 1, 7, 8, 7, 7, 4, 5, 8, 5, 9, 6, 6, 8, 7, 7, 6, 8, 9, 9, 3
Offset: 1

Views

Author

Scott R. Shannon, Mar 13 2023

Keywords

Comments

The first term a(1) = 1 lies at the (0,0) origin while all other terms lie on integer coordinates.

Examples

			a(5) = 2 as a(3) = 1 and a(4) = 1 lie on the horizontal line y = 1 relative to the starting square (assuming a counter-clockwise spiral) so a(5) cannot be 1.
a(7) = 3 as a(5) = 2 and a(6) = 2 lie on the vertical line x = -1 so a(7) cannot be 2, while a(1) = 1 and a(3) = 1 lie on the line y = x so a(7) cannot be 1.
a(21) = 4 as a(18) = 3 and a(19) = 3 lie on the line x = -2, a(6) = 2 and a(15) = 2 lie on the line y = 2*x + 2, while a(1) = 1 and a(3) = 1 lie on the line y = x, so a(21) cannot be 1, 2 or 3.
		

Crossrefs

A362027 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to a previously unvisited square with a number as close as possible to the number of the current square. If two such squares exist the smaller numbered square is chosen.

Original entry on oeis.org

1, 10, 3, 6, 9, 12, 15, 18, 7, 4, 11, 8, 5, 2, 13, 28, 25, 46, 21, 40, 17, 34, 59, 56, 29, 32, 55, 58, 33, 30, 53, 26, 47, 22, 19, 16, 37, 62, 95, 136, 91, 130, 87, 52, 49, 24, 27, 48, 51, 80, 83, 120, 123, 84, 81, 118, 77, 44, 41, 68, 103, 100, 63, 66, 39, 36, 61, 94, 57, 88, 127, 174, 229, 170
Offset: 1

Views

Author

Scott R. Shannon, Apr 05 2023

Keywords

Comments

This sequence is finite: after 130 squares have been visited the square with number 50 is reached after which all eight neighboring squares the knight could move to have already been visited. See the linked image. The largest visited square is a(117) = 247 while the smallest unvisited square is 20.

Examples

			The board is numbered with the square spiral:
.
  17--16--15--14--13   .
   |               |   .
  18   5---4---3  12   29
   |   |       |   |   |
  19   6   1---2  11   28
   |   |           |   |
  20   7---8---9--10   27
   |                   |
  21--22--23--24--25--26
.
a(6) = 12 as after the knight moves to the square containing 9 the available unvisited squares are 4, 12, 22, 26, 28, 46, 48. Of these 12, where |12 - 9| = 3, is the closest number to 9. This is the first term to differ from A316667.
		

Crossrefs

A368127 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 symmetrized variant of the distance-limited strip bijection described in A368126.

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, 6, 5, 4, 3
Offset: 0

Views

Author

Hugo Pfoertner, Jan 07 2024

Keywords

Crossrefs

A368128 gives the corresponding y-coordinates.
Analogous sequences, but without symmetrization: A367895, A367896.

Programs

  • PARI
    \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923.
    \\ It is assumed that the PARI programs from A367150 and A368126 have 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
    				
Previous Showing 41-50 of 81 results. Next