Original entry on oeis.org
0, 2, 4, 5, 6, 14, 9, 16, 12, 24, 13, 30, 19, 32, 33, 37, 34, 35, 22, 40, 51, 46, 52, 43, 29, 53, 60, 49, 50, 56, 70, 77, 80, 71, 78, 85, 92, 73, 90, 88, 97, 101, 104, 55, 105, 81, 96, 87, 94, 86, 58, 109, 67, 84, 124, 83, 125, 127, 115, 143, 91, 126, 141
Offset: 0
A324779
South-West spoke of spiral in A274641.
Original entry on oeis.org
0, 3, 5, 4, 13, 9, 10, 22, 15, 17, 20, 23, 18, 28, 45, 43, 29, 30, 57, 35, 32, 42, 40, 38, 39, 78, 77, 82, 46, 90, 56, 61, 55, 53, 60, 62, 58, 65, 114, 64, 72, 71, 74, 75, 130, 143, 91, 83, 80, 70, 81, 86, 163, 99, 171, 105, 103, 173, 178, 181, 104, 100, 190
Offset: 0
Original entry on oeis.org
0, 4, 1, 8, 12, 7, 6, 10, 9, 16, 18, 29, 22, 30, 15, 44, 33, 37, 38, 36, 42, 34, 55, 56, 50, 52, 63, 57, 39, 67, 62, 64, 72, 86, 47, 84, 91, 74, 99, 75, 51, 105, 106, 65, 109, 87, 116, 60, 107, 122, 124, 101, 127, 88, 103, 128, 133, 95, 131, 142, 115, 146
Offset: 0
A274640
Counterclockwise square spiral constructed by greedy algorithm, so that each row, column, and diagonal contains distinct numbers.
Original entry on oeis.org
1, 2, 3, 4, 2, 3, 4, 5, 6, 1, 4, 6, 2, 1, 6, 5, 3, 1, 5, 2, 6, 1, 2, 4, 5, 3, 7, 8, 5, 4, 9, 7, 8, 3, 10, 11, 4, 7, 8, 6, 3, 9, 5, 7, 8, 9, 10, 11, 12, 6, 8, 9, 11, 10, 12, 13, 7, 6, 10, 9, 12, 13, 14, 15, 8, 2, 9, 12, 7, 10, 11, 13, 14, 10, 9, 6, 13, 5, 3, 15, 16, 7, 1, 10, 13, 12, 14, 11, 15, 3, 8, 5, 1, 12, 11, 14, 7, 4, 2, 16, 9, 17, 1, 8, 11
Offset: 0
The spiral begins:
.
9--16---2---4---7--14--11--12---1---5---8
| |
17 8--15--14--13--12---9--10---6---7 3
| | | |
1 2 4--11--10---3---8---7---9 13 15
| | | | | |
8 9 7 3---5---6---1---2 4 12 11
| | | | | | | |
11 12 8 1 2---4---3 6 5 10 14
| | | | | | | | | |
15 7 6 5 3 1---2 4 8 11 12
| | | | | | | | |
14 10 3 2 4---5---6---1 7 9 13
| | | | | | |
7 11 9 6---1---2---4---5---3 8 10
| | | | |
4 13 5---7---8---9--10--11--12---6 1
| | |
12 14--10---9---6--13---5---3--15--16---7
|
10--15---1--12--16---8--14--13--11--18--17
.
The 8 spokes (A274924-A274931) begin:
E: 1, 2, 4, 8, 11, 12, 16, 9, 19, 24, 22, ...
NE: 1, 3, 2, 9, 7, 8, 12, 15, 13, 17, 20, ...
N: 1, 4, 6, 3, 12, 14, 15, 18, 20, 26, 25, ...
NW: 1, 2, 3, 4, 8, 9, 7, 11, 14, 10, 22, ...
W: 1, 3, 5, 6, 7, 15, 10, 17, 13, 25, 14, ...
SW: 1, 4, 6, 5, 14, 10, 11, 23, 16, 18, 21, ...
S: 1, 5, 2, 9, 13, 8, 7, 11, 10, 17, 19, ...
SE: 1, 6, 5, 12, 16, 17, 21, 24, 27, 13, 15, ...
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
- F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52.
- Alois P. Heinz, Distribution of a(n) for n <= 4010000
- Kerry Mitchell, Color-coded version of spiral, (1): the colors represent the values, from black (small) to white (large) (jpg file, low resolution)
- Kerry Mitchell, Color-coded version of spiral, (1a): the colors represent the values, from black (small) to white (large) (tiff file, much higher resolution)
- Kerry Mitchell, Color-coded version of spiral, (2): values <= 100 are black and those > 100 are white.
- Zak Seidov, Distribution of a(n) for first 20001 terms
In the same spirit as the infinite Sudoku array
A269526.
Cf.
A274821 (the same construction on a hexagonal tiling).
-
# Maple program from Alois P. Heinz, Jul 12 2016:
fx:= proc(n) option remember; `if`(n=1, 0, (k->
fx(n-1)+sin(k*Pi/2))(floor(sqrt(4*(n-2)+1)) mod 4))
end:
fy:= proc(n) option remember; `if`(n=1, 0, (k->
fy(n-1)-cos(k*Pi/2))(floor(sqrt(4*(n-2)+1)) mod 4))
end:
b:= proc() 0 end:
a:= proc(n) local x,y,s,i,t,m;
x, y:= fx(n+1), fy(n+1);
if b(x, y) > 0 then b(x, y)
else s:={};
for i do t:=b(x+i,y+i); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x-i,y-i); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x+i,y-i); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x-i,y+i); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x+i,y ); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x-i,y ); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x ,y+i); if t>0 then s:=s union {t} else break fi od;
for i do t:=b(x ,y-i); if t>0 then s:=s union {t} else break fi od;
for m while m in s do od;
b(x,y):= m
fi
end:
seq(a(n), n=0..1000);
-
fx[n_] := fx[n] = If[n == 1, 0, Function[k, fx[n-1] + Sin[k*Pi/2]][Mod[Floor[Sqrt[4*(n-2)+1]], 4]]]; fy[n_] := fy[n] = If[n == 1, 0, Function[k, fy[n-1] - Cos[k*Pi/2]][Mod[Floor[Sqrt[4*(n-2)+1]], 4]]]; Clear[b]; 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]]; Table[a[n], {n, 0, 1000}] (* Jean-François Alcover, Nov 14 2016, after Alois P. Heinz *)
-
class Lines: # manage lines in direction d = dx + dy*1j
def _init_(self, d):
self.lines={}; self.t = d.real/d.imag if d.imag else None
def _call_(self, pos): # Return the line through pos in direction d
index = pos.imag if self.t is None else pos.real - pos.imag*self.t
if index not in self.lines: self.lines[index] = Values()
return self.lines[index]
class Values(set): # the set of used numbers on a given line
def next(self, n): # return least k >= n not on this line
return min(m+1 for m in self if m+1 >= n and m+1 not in self
) if n in self else n
def A274640(): # generator of the sequence, see below for possible usage
lines = [Lines(d) for d in (1, 1+1j, 1j, 1-1j)]; pos = 0
for side in range(9**9):
for _ in range(side//2 + 1):
n = 1; lines_here = [L(pos) for L in lines]
while any(n < (n := L.next(n)) for L in lines_here): pass
yield n; any(L.add(n) for L in lines_here); pos += 1j**side
[a for a,A274640(),range(99))%5D%20%23%20_M.%20F.%20Hasler"> in zip(A274640(),range(99))] # _M. F. Hasler, Feb 01 2025
A317186
One of many square spiral sequences: a(n) = n^2 + n - floor((n-1)/2).
Original entry on oeis.org
1, 2, 6, 11, 19, 28, 40, 53, 69, 86, 106, 127, 151, 176, 204, 233, 265, 298, 334, 371, 411, 452, 496, 541, 589, 638, 690, 743, 799, 856, 916, 977, 1041, 1106, 1174, 1243, 1315, 1388, 1464, 1541, 1621, 1702, 1786, 1871, 1959, 2048, 2140, 2233, 2329, 2426
Offset: 0
The square spiral when started with 1 begins:
.
100--99--98--97--96--95--94--93--92--91
|
65--64--63--62--61--60--59--58--57 90
| | |
66 37--36--35--34--33--32--31 56 89
| | | | |
67 38 17--16--15--14--13 30 55 88
| | | | | | |
68 39 18 5---4---3 12 29 54 87
| | | | | | | | |
69 40 19 6 1---2 11 28 53 86
| | | | | | | |
70 41 20 7---8---9--10 27 52 85
| | | | | |
71 42 21--22--23--24--25--26 51 84
| | | |
72 43--44--45--46--47--48--49--50 83
| |
73--74--75--76--77--78--79--80--81--82
.
For the square spiral when started with 0, subtract 1 from each entry. In the following diagram this spiral has been reflected and rotated, but of course that makes no difference to the sequences:
.
99 64--65--66--67--68--69--70--71--72
| | |
98 63 36--37--38--39--40--41--42 73
| | | | |
97 62 35 16--17--18--19--20 43 74
| | | | | | |
96 61 34 15 4---5---6 21 44 75
| | | | | | | | |
95 60 33 14 3 0 7 22 45 76
| | | | | | | | | |
94 59 32 13 2---1 8 23 46 77
| | | | | | | |
93 58 31 12--11--10---9 24 47 78
| | | | | |
92 57 30--29--28--27--26--25 48 79
| | | |
91 56--55--54--53--52--51--50--49 80
| |
90--89--88--87--86--85--84--83--82--81
.
From _Omar E. Pol_, Jan 24 2025: (Start)
For n = 0 there is only one free polyomino with 0 + 4 = 4 cells whose difference between length and width is 0 as shown below, so a(0) = 1.
_ _
|_|_|
|_|_|
.
For n = 1 there are two free polyominoes with 1 + 4 = 5 cells whose difference between length and width is 1 as shown below, so a(1) = 2.
_ _ _ _
|_|_| |_|_|
|_|_| |_|_
|_| |_|_|
.
(End)
Filling in these two squares spirals with greedy algorithm:
A274640,
A274641.
-
a[n_] := n^2 + n - Floor[(n - 1)/2]; Array[a, 50, 0] (* Robert G. Wilson v, Aug 01 2018 *)
LinearRecurrence[{2, 0, -2 , 1},{1, 2, 6, 11},50] (* or *)
CoefficientList[Series[(- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)), {x, 0, 50}], x] (* Stefano Spezia, Sep 02 2018 *)
A274820
Spiral constructed on the nodes of the infinite triangular net in which each term is the least nonnegative integer such that no diagonal contains a repeated term.
Original entry on oeis.org
0, 1, 2, 1, 2, 1, 2, 0, 3, 0, 4, 3, 5, 3, 4, 5, 3, 4, 6, 5, 6, 7, 4, 6, 5, 7, 6, 3, 0, 6, 5, 7, 0, 6, 7, 5, 4, 8, 1, 3, 6, 8, 1, 9, 7, 8, 2, 4, 9, 8, 2, 10, 11, 8, 9, 10, 12, 3, 8, 9, 7, 10, 9, 2, 4, 8, 5, 10, 2, 11, 9, 11, 0, 10, 7, 8, 6, 0, 9, 7, 10, 12, 7, 1, 4, 8, 5, 11, 1, 10, 12, 9, 5, 11, 10, 13, 12, 11, 13, 14
Offset: 0
Illustration of initial terms as a spiral:
.
. 9 - 4 - 2 - 8 - 7
. / \
. 8 3 - 6 - 7 - 5 9
. / / \ \
. 2 0 5 - 3 - 4 6 1
. / / / \ \ \
. 10 6 3 1 - 2 0 4 8
. / / / / \ \ \ \
. 11 5 4 2 0 - 1 3 7 6
. \ \ \ \ / / /
. 8 7 5 1 - 2 - 0 6 3
. \ \ \ / /
. 9 0 3 - 4 - 6 - 5 1
. \ \ /
. 10 6 - 7 - 5 - 4 - 8
. \
. 12 - 3 - 8 - 9 - 7
.
- Rémy Sigrist, Table of n, a(n) for n = 0..120400
- F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52.
- Rémy Sigrist, PARI program for A274820
- Rémy Sigrist, Colored illustration of the first 200 windings of the spiral (where the color is a function of a(n))
- N. J. A. Sloane, Illustration of initial terms drawn as a spiral on the hexagonal grid (the starting cell is marked in black).
Cf.
A001477,
A269526,
A274528 (square array),
A274641 (spiral on the square grid),
A274650 (right triangle),
A274821,
A274920,
A274921,
A275606,
A275610,
A296339.
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
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
A307282
Sprague-Grundy values for Maharaja Nim on the counterclockwise square spiral.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 4, 6, 5, 7, 9, 8, 10, 1, 9, 2, 10, 3, 9, 11, 10, 2, 0, 3, 11, 10, 4, 1, 0, 6, 12, 7, 5, 3, 0, 8, 7, 1, 4, 5, 0, 2, 1, 12, 13, 6, 7, 1, 14, 8, 12, 3, 2, 9, 8, 10, 3, 2, 13, 4, 6, 7, 11, 13, 6, 12, 15, 14, 16, 8, 10, 7, 14, 4, 5, 3, 15
Offset: 0
The counterclockwise square spiral begins:
.
16--15--14--13--12
| |
17 4---3---2 11 .
| | | |
18 5 0---1 10 .
| | |
19 6---7---8---9 .
|
20--21--22--23--24--25
.
- Rémy Sigrist, Table of n, a(n) for n = 0..10200 (-50 <= x <= 50 and -50 <= y <= 50)
- F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52.
- Urban Larsson and Johan Wastlund, Maharaja Nim: Wythoff’s Queen meets the Knight, arXiv 1207.0765 [math.CO], 2012.
- Urban Larsson and Johan Wästlund, Maharaja Nim: Wythoff's Queen meets the Knight, Integers: Electronic Journal of Combinatorial Number Theory 14 (2014), #G05.
- Rémy Sigrist, Colored representation of the spiral for x = -500..500 and y = -500..500 (where the hue is function of T(x,y) and black pixels correspond to 0's)
- Rémy Sigrist, PARI program for A307282
- N. J. A. Sloane, Illustration of initial terms.
A280027
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 can be seen from that cell.
Original entry on oeis.org
1, 1, 2, 4, 7, 13, 23, 42, 76, 146, 239, 441, 852, 1389, 2536, 4971, 9832, 15312, 27964, 54801, 108787, 169086, 308758, 603612, 1201837, 2397202, 3656904, 6687912, 13067709, 25998877, 51918269, 79176868, 144799285, 282915788, 562653823, 1124083053, 2246758839
Offset: 0
The central portion of the spiral is:
.
7----4----2
| |
13 1----1 239
| |
23---42---76--146
.
After the terms a(0) to a(8) of the spiral have been filled in, the next cell contains 76+42+23+1+4 = 146 = a(9).
Comments