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 51 results. Next

A274641 Counterclockwise square spiral constructed by greedy algorithm, so that each row, column, and diagonal contains distinct numbers. Start with 0 (so in this version a(n) = A274640(n) - 1).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 09 2016, based on the entry A274640 from Zak Seidov and Kerry Mitchell, Jun 30 2016

Keywords

Comments

See A274640 for further information.
Presumably every row, column, and diagonal is a permutation of the natural numbers, but is there a proof? - N. J. A. Sloane, Jul 10 2016

Examples

			From _Jon E. Schoenfield_, Dec 26 2016: (Start)
The spiral begins:
.
   8--15---1---3---6--13--10--11---0---4---7
   |                                       |
  16   7--14--13--12--11---8---9---5---6   2
   |   |                               |   |
   0   1   3--10---9---2---7---6---8  12  14
   |   |   |                       |   |   |
   7   8   6   2---4---5---0---1   3  11  10
   |   |   |   |               |   |   |   |
  10  11   7   0   1---3---2   5   4   9  13
   |   |   |   |   |       |   |   |   |   |
  14   6   5   4   2   0---1   3   7  10  11
   |   |   |   |   |           |   |   |   |
  13   9   2   1   3---4---5---0   6   8  12
   |   |   |   |                   |   |   |
   6  10   8   5---0---1---3---4---2   7   9
   |   |   |                           |   |
   3  12   4---6---7---8---9--10--11---5   0
   |   |                                   |
  11  13---9---8---5--12---4---2--14--15---6
   |
   9--14---0--11--15---7--13--12--10--17--16
.
(End)
		

Crossrefs

Cf. A274640 (if start with 1 at center), A324481 (position of first n).
For the eight spokes see A324774-A324781.

A274924 East spoke of spiral in A274640.

Original entry on oeis.org

1, 2, 4, 8, 11, 12, 16, 9, 19, 24, 22, 18, 27, 26, 21, 37, 43, 39, 40, 49, 28, 29, 32, 46, 55, 60, 45, 48, 66, 73, 70, 76, 83, 77, 65, 75, 42, 62, 94, 96, 101, 103, 67, 63, 112, 80, 113, 58, 107, 64, 108, 120, 109, 69, 124, 130, 140, 134, 122, 133, 139, 129
Offset: 0

Views

Author

N. J. A. Sloane, Jul 12 2016

Keywords

Crossrefs

Cf. A274640, A274641. The 8 spokes are A274924-A274931.

Extensions

More terms from Alois P. Heinz, Jul 12 2016

A274931 Southeast spoke of spiral in A274640.

Original entry on oeis.org

1, 6, 5, 12, 16, 17, 21, 24, 27, 13, 15, 36, 40, 43, 47, 54, 23, 56, 59, 62, 39, 68, 69, 35, 46, 37, 42, 90, 50, 97, 94, 99, 102, 57, 107, 115, 117, 116, 120, 66, 130, 131, 73, 77, 140, 143, 76, 80, 78, 159, 161, 156, 165, 92, 91, 174, 89, 181, 104, 187, 190
Offset: 0

Views

Author

N. J. A. Sloane, Jul 12 2016

Keywords

Crossrefs

Cf. A274640, A274641. The 8 spokes are A274924-A274931.

Extensions

More terms from Alois P. Heinz, Jul 12 2016

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

A275172 Positions of 3 in A274640.

Original entry on oeis.org

2, 5, 16, 25, 33, 40, 78, 89, 158, 172, 221, 237, 376, 395, 415, 523, 570, 749, 777, 790, 876, 923, 1016, 1114, 1182, 1303, 1341, 1473, 1512, 1754, 1839, 1970, 2105, 2267, 2315, 2488, 2538, 2957, 3012, 3204, 3262, 3467, 3527, 3646, 3983, 4110, 4276, 4744, 4815
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n)) = 3.

A275188 Positions of 8 in A274640.

Original entry on oeis.org

27, 32, 38, 44, 50, 64, 90, 103, 115, 125, 160, 181, 187, 207, 225, 325, 381, 669, 778, 806, 906, 1096, 1217, 1490, 1551, 1691, 1732, 1817, 1901, 2036, 2172, 2244, 2313, 2388, 2537, 2590, 2664, 2745, 2770, 2956, 3038, 3293, 3735, 3797, 3857, 4080, 4210, 4274
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n)) = 8.

A275189 Positions of 4 in A274640.

Original entry on oeis.org

3, 6, 10, 23, 29, 36, 97, 108, 185, 199, 252, 310, 337, 404, 424, 446, 618, 631, 707, 833, 848, 905, 1000, 1097, 1196, 1253, 1269, 1378, 1511, 1552, 1796, 1815, 2014, 2060, 2363, 2589, 2640, 2692, 2928, 3179, 3261, 3554, 3673, 3768, 3829, 4370, 4504, 4707
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n))=4.

A275190 Positions of 5 in A274640.

Original entry on oeis.org

7, 15, 18, 24, 28, 42, 77, 91, 142, 227, 261, 275, 356, 374, 384, 479, 501, 670, 735, 763, 791, 863, 1050, 1130, 1164, 1288, 1492, 1631, 1648, 1713, 1838, 2015, 2034, 2268, 2413, 2562, 2611, 2715, 2767, 3036, 3148, 3263, 3319, 3954, 4046, 4145, 4541, 4676
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n)) = 5.

A275191 Positions of 6 in A274640.

Original entry on oeis.org

8, 11, 14, 20, 39, 49, 57, 75, 145, 178, 222, 292, 319, 416, 425, 546, 655, 721, 734, 862, 892, 924, 1030, 1113, 1129, 1287, 1342, 1414, 1608, 1797, 1859, 1947, 2104, 2125, 2173, 2342, 2462, 2691, 2714, 2983, 3236, 3408, 3494, 3955, 4081, 4240, 4474, 4677
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n)) = 6.

A275192 Positions of 7 in A274640.

Original entry on oeis.org

26, 31, 37, 43, 56, 68, 81, 96, 107, 127, 144, 162, 208, 247, 304, 358, 363, 509, 579, 894, 1048, 1080, 1115, 1398, 1590, 1630, 1671, 1731, 1882, 1925, 2151, 2198, 2245, 2612, 2743, 2768, 2849, 2902, 2927, 3011, 3320, 3436, 3493, 3645, 3706, 4017, 4341, 4572
Offset: 1

Views

Author

Zak Seidov, Jul 19 2016

Keywords

Crossrefs

Formula

A274640(a(n)) = 7.
Showing 1-10 of 51 results. Next