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-10 of 32 results. Next

A308884 Follow along the squares in the square spiral (as in A274641); in each square write the smallest nonnegative number that a knight placed at that square cannot see.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 3, 3, 2, 0, 1, 3, 2, 1, 0, 3, 3, 3, 2, 0, 1, 3, 3, 1, 0, 0, 0, 3, 3, 0, 0, 0, 2, 1, 3, 3, 0, 0, 0, 2, 2, 3, 2, 0, 0, 0, 2, 1, 3, 3, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 3, 2, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 01 2019

Keywords

Comments

Similar to A274641, except that here we consider the mex of squares that are a knight's moves rather than queen's moves.
Since there are at most 4 earlier cells in the spiral at a knight's move from any square, a(n) <= 4.

Examples

			A knight at square 0 cannot see any numbers, so a(0)=0. Similarly a(1)=a(2)=a(3)=0.
A knight at square 4 in the spiral can see the 0 in square 1 (because square 1 is a knight's move from square 4), so a(4) = 1. Similarly a(5)=a(6)=1.
A knight at square 7 can see a(2)=0 and a(4)=1, so a(7) = mex{0,1} = 2.
And so on. See the illustration for the start of the spiral.
		

Crossrefs

A273059 Positions of 1's in A274640: Greedy Queens on a spiral. Equivalently, positions of 0's in A274641.

Original entry on oeis.org

0, 9, 13, 17, 21, 82, 92, 102, 112, 228, 244, 260, 276, 445, 467, 489, 511, 630, 656, 682, 708, 967, 999, 1031, 1063, 1377, 1415, 1453, 1491, 1858, 1902, 1946, 1990, 2411, 2461, 2511, 2561, 3037, 3093, 3149, 3205, 3734, 3796, 3858, 3920, 4239, 4305, 4371, 4437, 5056, 5128, 5200, 5272, 5946
Offset: 0

Views

Author

Zak Seidov, Jul 14 2016

Keywords

Comments

What is the reason for the three "lines" in the graph of first differences (see link, also A275915)?
Apparently they are related to the fact that "ones" are concentrated along two main diagonals of the spiral A274640, see the graph "Spiral A274640 with ones shown".
This is the Greedy Queens construction on a spiral (cf. A065188). Follow a counterclockwise spiral starting at the origin, and place a queen iff it is not attacked by any existing queen. This same problem is described in a different but equivalent way in A140100 and A140101. See A140101 for a conjectured recurrence which underlies all these sequences. - N. J. A. Sloane, Aug 28-30, 2016

Crossrefs

Cf. A274640, A065188, A275915 (first differences).
The four spokes are A275916, A275917, A275918, A275919.
A140100 and A140101 describe this same problem in a different way.

Programs

  • Maple
    # see link above
  • Mathematica
    fx[n_] := fx[n] = If[n == 1, 0, fx[n - 1] + Sin[#*Pi/2]& @ Mod[Floor[Sqrt[ 4*(n - 2) + 1]], 4]];
    fy[n_] := fy[n] = If[n == 1, 0, fy[n - 1] - Cos[k*Pi/2]& @ Mod[Floor[Sqrt[ 4*(n - 2) + 1]], 4]];
    b[, ] = 0;
    a[n_] := Module[{x, y, s, i, t, m}, {x, y} = {fx[n + 1], fy[n + 1]}; If[b[x, y] > 0, b[x, y], s = {};
    For[i=1, True, i++, t = b[x+i, y+i]; If[t>0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x-i, y-i]; If[t>0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x+i, y-i]; If[t>0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x-i, y+i]; If[t>0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x+i, y]; If[t > 0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x-i, y]; If[t > 0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x, y+i]; If[t > 0, s = Union[s, {t}], Break[]]];
    For[i=1, True, i++, t = b[x, y-i]; If[t > 0, s = Union[s, {t}], Break[]]];
    m = 1; While[MemberQ[s, m], m++]; b[x, y] = m]];
    Flatten[Position[a /@ Range[0, 10^4], 1]] - 1 (* Jean-François Alcover, Feb 25 2020, after Alois P. Heinz *)

Formula

A274640(a(n)) = 1 (this is simply a restatement of the definition).

Extensions

Offset changed to 0 by N. J. A. Sloane, Aug 31 2016

A324774 East spoke of spiral in A274641.

Original entry on oeis.org

0, 1, 3, 7, 10, 11, 15, 8, 18, 23, 21, 17, 26, 25, 20, 36, 42, 38, 39, 48, 27, 28, 31, 45, 54, 59, 44, 47, 65, 72, 69, 75, 82, 76, 64, 74, 41, 61, 93, 95, 100, 102, 66, 62, 111, 79, 112, 57, 106, 63, 107, 119, 108, 68, 123, 129, 139
Offset: 0

Views

Author

N. J. A. Sloane, Jul 05 2019

Keywords

Crossrefs

The 8 spokes are A324774-A324781. To get them, subtract 1 from A274924-A274931, respectively.

A324781 South-East spoke of spiral in A274641.

Original entry on oeis.org

0, 5, 4, 11, 15, 16, 20, 23, 26, 12, 14, 35, 39, 42, 46, 53, 22, 55, 58, 61, 38, 67, 68, 34, 45, 36, 41, 89, 49, 96, 93, 98, 101, 56, 106, 114, 116, 115, 119, 65, 129, 130, 72, 76, 139, 142, 75, 79, 77, 158, 160, 155, 164, 91, 90, 173, 88, 180, 103, 186, 189
Offset: 0

Views

Author

N. J. A. Sloane, Jul 05 2019

Keywords

Crossrefs

The 8 spokes are A324774-A324781. To get them, subtract 1 from A274924-A274931, respectively.

A308896 Walk a rook along the square spiral numbered 0, 1, 2, ... (cf. A274641); a(n) = mex of earlier values the rook can move to.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 0, 2, 3, 1, 2, 3, 0, 2, 3, 1, 4, 5, 6, 7, 0, 4, 5, 6, 7, 1, 4, 5, 6, 7, 0, 4, 5, 6, 7, 1, 2, 5, 4, 7, 6, 3, 0, 2, 5, 4, 7, 6, 3, 1, 2, 5, 4, 7, 6, 3, 0, 2, 5, 4, 7, 6, 3, 1, 8, 9, 10, 11, 12, 13, 14, 15, 0, 8, 9, 10, 11, 12, 13, 14, 15, 1, 8
Offset: 0

Views

Author

N. J. A. Sloane, Jul 02 2019

Keywords

Comments

Analog of A308884 but using a rook rather than a knight.
The array of values - see the illustration in the link - appears to have a number of interesting symmetries.

Examples

			The central 21 X 21 portion of the plane:
[ 4  1  3 30 31 28 29 26 27 24 25 22 23 20 21 18 19 16 17  2  0]
[ 5  2  1 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16  0  3]
[18 17 16  1  3  6  7 12 13 14 15  8  9 10 11  4  5  2  0 31 30]
[19 16 17  2  1  7  6 13 12 15 14  9  8 11 10  5  4  0  3 30 31]
[16 19 18  5  4  1  3 14 15 12 13 10 11  8  9  2  0  7  6 29 28]
[17 18 19  4  5  2  1 15 14 13 12 11 10  9  8  0  3  6  7 28 29]
[22 21 20 11 10  9  8  1  3  6  7  4  5  2  0 15 14 13 12 27 26]
[23 20 21 10 11  8  9  2  1  7  6  5  4  0  3 14 15 12 13 26 27]
[20 23 22  9  8 11 10  5  4  1  3  2  0  7  6 13 12 15 14 25 24]
[21 22 23  8  9 10 11  4  5  2  1  0  3  6  7 12 13 14 15 24 25]
*26 25 24 15 14 13 12  7  6  3 *0* 1  2  5  4 11 10  9  8 23 22]
[27 24 25 14 15 12 13  6  7  0  2  3  1  4  5 10 11  8  9 22 23]
[24 27 26 13 12 15 14  3  0  4  5  6  7  1  2  9  8 11 10 21 20]
[25 26 27 12 13 14 15  0  2  5  4  7  6  3  1  8  9 10 11 20 21]
[30 29 28  7  6  3  0  8  9 10 11 12 13 14 15  1  2  5  4 19 18]
[31 28 29  6  7  0  2  9  8 11 10 13 12 15 14  3  1  4  5 18 19]
[28 31 30  3  0  4  5 10 11  8  9 14 15 12 13  6  7  1  2 17 16]
[29 30 31  0  2  5  4 11 10  9  8 15 14 13 12  7  6  3  1 16 17]
[ 6  3  0 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  1  2]
[ 7  0  2 17 16 19 18 21 20 23 22 25 24 27 26 29 28 31 30  3  1]
[ 0  4  5 18 19 16 17 22 23 20 21 26 27 24 25 30 31 28 29  6  7]
===============================**===============================
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 0, 1 iff n belongs to A002378, A085046, respectively. - Rémy Sigrist, Jul 02 2019
For formulas for the terms in the array, see the "Explicit formulas" link.

Extensions

More terms from Rémy Sigrist, Jul 02 2019

A324481 Index of first occurrence of n in the spiral shown in A274641.

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 26, 27, 30, 34, 35, 48, 55, 62, 63, 80, 101, 119, 130, 131, 155, 180, 210, 224, 253, 254, 271, 303, 305, 321, 322, 323, 419, 483, 504, 505, 568, 571, 573, 624, 649, 650, 728, 755, 810, 812, 840, 898, 953, 954, 956, 957, 959, 960, 1189
Offset: 0

Views

Author

N. J. A. Sloane, Mar 11 2019

Keywords

Comments

Also index of first occurrence of n+1 in the spiral shown in A274640.

Crossrefs

Programs

  • Python
    A324481 = lambda n: next(i for i,a in enumerate(A274640()) if a==n+1) # slow
    
  • Python
    def A324481(): # generator of the sequence
       n=1
       for i,a in enumerate(A274640()):
          if a==n: yield i; n += 1
    [a for a,A324481(),range(99))%5D%20%23%20_M.%20F.%20Hasler"> in zip(A324481(),range(99))] # _M. F. Hasler, Feb 01 2025

Formula

Conjecture: a(n) = c(n)*n^2 with 0.32 <= c(n) <= 1 for all n, maybe lim c(n) ~ 0.4. - M. F. Hasler, Feb 01 2025

A324480 Consider the numbers on the x-axis in the spiral shown in A274641; a(n) is the distance from n to the origin, or -1 if n never appears on the x-axis.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 3, 7, 6, 4, 5, 8, 10, 5, 6, 7, 11, 8, 12, 14, 10, 18, 9, 9, 13, 12, 20, 21, 24, 11, 22, 13, 14, 16, 17, 15, 15, 17, 18, 19, 36, 16, 23, 26, 23, 21, 27, 19, 27, 28, 20, 22, 25, 24, 43, 29, 47, 50, 25, 26, 37, 43, 49, 34, 28, 42, 52, 53, 30, 30
Offset: 0

Views

Author

N. J. A. Sloane, Mar 11 2019

Keywords

Comments

It is conjectured that every nonnegative number appears on the x-axis exactly once.
a(n) is also the distance to the origin from the point n+1 on the x-axis in A274640.

Examples

			The portion of the x-axis near 0 is:
... 14   6   5   4   2   0   1   3   7  10  11 ...
and we see that both 1 and 2 are at distance 1 from 0. So a(1) = a(2) = 1.
		

Crossrefs

The positive and negative x-axes are given in A274924 and A274928.

Programs

  • PARI
    See Links section.

Extensions

More terms from Jinyuan Wang, Feb 27 2020

A324775 North-East spoke of spiral in A274641.

Original entry on oeis.org

0, 2, 1, 8, 6, 7, 11, 14, 12, 16, 19, 21, 25, 41, 26, 24, 27, 49, 34, 31, 36, 33, 37, 67, 47, 48, 79, 44, 52, 84, 92, 50, 51, 94, 59, 54, 66, 69, 115, 63, 128, 68, 76, 132, 73, 141, 85, 88, 93, 152, 89, 151, 95, 96, 87, 97, 101, 169, 102, 108, 98, 189, 185
Offset: 0

Views

Author

N. J. A. Sloane, Jul 05 2019

Keywords

Crossrefs

The 8 spokes are A324774-A324781. To get them, subtract 1 from A274924-A274931, respectively.

A324776 North spoke of spiral in A274641.

Original entry on oeis.org

0, 3, 5, 2, 11, 13, 14, 17, 19, 25, 24, 26, 20, 28, 21, 40, 31, 23, 35, 32, 45, 27, 41, 54, 49, 61, 59, 70, 68, 73, 53, 79, 81, 46, 43, 77, 90, 48, 97, 92, 78, 58, 85, 89, 108, 69, 100, 76, 119, 118, 96, 129, 117, 71, 66, 135, 130, 82, 140, 93, 123, 152, 138
Offset: 0

Views

Author

N. J. A. Sloane, Jul 05 2019

Keywords

Crossrefs

The 8 spokes are A324774-A324781. To get them, subtract 1 from A274924-A274931, respectively.

A324777 North-West spoke of spiral in A274641.

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 6, 10, 13, 9, 21, 28, 17, 18, 24, 25, 19, 29, 32, 27, 30, 31, 44, 66, 40, 33, 37, 43, 47, 50, 48, 99, 54, 51, 57, 52, 59, 60, 63, 62, 120, 74, 69, 64, 70, 71, 82, 80, 73, 78, 83, 81, 85, 87, 84, 86, 175, 94, 95, 92, 105, 102, 108, 111, 104
Offset: 0

Views

Author

N. J. A. Sloane, Jul 05 2019

Keywords

Crossrefs

The 8 spokes are A324774-A324781. To get them, subtract 1 from A274924-A274931, respectively.
Showing 1-10 of 32 results. Next