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.

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