A137932
Terms in an n X n spiral that do not lie on its principal diagonals.
Original entry on oeis.org
0, 0, 0, 4, 8, 16, 24, 36, 48, 64, 80, 100, 120, 144, 168, 196, 224, 256, 288, 324, 360, 400, 440, 484, 528, 576, 624, 676, 728, 784, 840, 900, 960, 1024, 1088, 1156, 1224, 1296, 1368, 1444, 1520, 1600, 1680, 1764, 1848, 1936, 2024, 2116, 2208, 2304, 2400, 2500, 2600, 2704, 2808
Offset: 0
a(0) = 0^2 - (2(0) - mod(0,2)) = 0.
a(3) = 3^2 - (2(3) - mod(3,2)) = 4.
- Enrique Pérez Herrero, Table of n, a(n) for n = 0..5000
- Kival Ngaokrajang, Illustration of initial terms.
- Eric Weisstein's World of Mathematics, Complete Bipartite Graph.
- Eric Weisstein's World of Mathematics, Graph Circumference.
- Eric Weisstein's World of Mathematics, Graph Crossing Number.
- Eric Weisstein's World of Mathematics, Grid Graph.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
-
A137932:=n->2*floor((n-1)^2/2); seq(A137932(n), n=0..50); # Wesley Ivan Hurt, Apr 19 2014
-
Table[2 Floor[(n - 1)^2/2], {n, 0, 20}] (* Enrique Pérez Herrero, Jul 04 2012 *)
2 Floor[(Range[20] - 1)^2/2] (* Eric W. Weisstein, Sep 11 2018 *)
Table[n^2 - 2 n + (1 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Sep 11 2018 *)
LinearRecurrence[{2, 0, -2, 1}, {0, 0, 4, 8}, 20] (* Eric W. Weisstein, Sep 11 2018 *)
CoefficientList[Series[-((4 x^2)/((-1 + x)^3 (1 + x))), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 11 2018 *)
-
A137932(n)={ return(n^2 - (2*n-n%2))} ;
print(vector(30,n,A137932(n-1))); /* R. J. Mathar, May 12 2014 */
-
a = lambda n: n**2 - (2*n - (n%2))
A156859
The main column of a version of the square spiral.
Original entry on oeis.org
0, 3, 7, 14, 22, 33, 45, 60, 76, 95, 115, 138, 162, 189, 217, 248, 280, 315, 351, 390, 430, 473, 517, 564, 612, 663, 715, 770, 826, 885, 945, 1008, 1072, 1139, 1207, 1278, 1350, 1425, 1501, 1580, 1660, 1743, 1827, 1914, 2002, 2093, 2185, 2280, 2376, 2475, 2575
Offset: 0
Emilio Apricena (emilioapricena(AT)yahoo.it), Feb 17 2009
- E. Apricena, A version of Ulam Spiral divided into four parts.
- Minh Nguyen, 2-adic Valuations of Square Spiral Sequences, Honors Thesis, Univ. of Southern Mississippi (2021).
- Marco Ripà, The n x n x n Points Problem Optimal Solution, viXra.org.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
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 *)
A346875
Irregular triangle read by rows in which row n lists the row A000384(n) of A237591, n >= 1.
Original entry on oeis.org
1, 4, 1, 1, 8, 3, 2, 1, 1, 15, 5, 3, 2, 1, 1, 1, 23, 8, 5, 2, 2, 2, 1, 1, 1, 34, 11, 6, 4, 3, 2, 2, 1, 1, 1, 1, 46, 16, 8, 5, 4, 2, 3, 1, 2, 1, 1, 1, 1, 61, 20, 11, 6, 5, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 77, 26, 14, 8, 5, 5, 3, 2, 3, 2, 1, 2, 1, 1, 1, 1, 1, 96, 32, 16
Offset: 1
Triangle begins:
1;
4, 1, 1;
8, 3, 2, 1, 1;
15, 5, 3, 2, 1, 1, 1;
23, 8, 5, 2, 2, 2, 1, 1, 1;
34, 11, 6, 4, 3, 2, 2, 1, 1, 1, 1;
46, 16, 8, 5, 4, 2, 3, 1, 2, 1, 1, 1, 1;
61, 20, 11, 6, 5, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1;
77, 26, 14, 8, 5, 5, 3, 2, 3, 2, 1, 2, 1, 1, 1, 1, 1;
96, 32, 16, 10, 7, 5, 4, 3, 3, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1;
...
Illustration of initial terms:
Column H gives the nonzero hexagonal numbers (A000384).
Column S gives the sum of the divisors of the hexagonal numbers which equals the area (and the number of cells) of the associated diagram.
-------------------------------------------------------------------------
n H S Diagram
-------------------------------------------------------------------------
_ _ _ _
1 1 1 |_| | | | | | |
1 | | | | | |
_ _| | | | | |
| _| | | | |
_ _ _| _| | | | |
2 6 12 |_ _ _ _| 1 | | | |
4 1 | | | |
_ _ _|_| | |
_ _| | | |
| _| | |
_| _| | |
|_ _|1 1 | |
| 2 | |
_ _ _ _ _ _ _ _|4 _ _ _ _ _| |
3 15 24 |_ _ _ _ _ _ _ _| | _ _ _ _ _|
8 | |
_ _| |
_ _| _ _|
| _|
_| _|
| _|1 1
_ _ _| | 1
| _ _ _|2
| | 3
| |
| |5
_ _ _ _ _ _ _ _ _ _ _ _ _ _| |
4 28 56 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
15
.
A272904
Rectangular array, by antidiagonals: row n gives the positions of n in the Fibonacci-products fractal sequence, A272900.
Original entry on oeis.org
1, 2, 4, 3, 6, 8, 5, 9, 11, 15, 7, 12, 14, 19, 23, 10, 16, 18, 24, 28, 34, 13, 20, 22, 29, 33, 40, 46, 17, 25, 27, 35, 39, 47, 53, 61, 21, 30, 32, 41, 45, 54, 60, 69, 77, 26, 36, 38, 48, 52, 62, 68, 78, 86, 96, 31, 42, 44, 55, 59, 70, 76, 87, 95, 106, 116
Offset: 1
Northwest corner:
1 2 3 4 6 9 12 15
5 7 10 13 17 21 26 31
8 11 14 18 2 27 32 38
16 20 25 30 36 42 49 56
23 28 33 39 45 52 59 67
35 41 48 55 63 71 80 89
46 53 60 68 76 85 94 104
-
z = 500; f[n_] := Fibonacci[n + 1]; u1 = Table[f[n], {n, 1, z}];
u2 = Sort[Flatten[Table[f[i]*f[j], {i, 1, z}, {j, i, z}]]];
uf = Table[Select[Range[80], MemberQ[u1, u2[[i]]/f[#]] &][[1]], {i, 1, z}]
r[n_, k_] := Flatten[Position[uf, n]][[k]]
TableForm[Table[r[n, k], {n, 1, 12}, {k, 1, 12}]] (* A272904 array *)
t = Table[r[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (* A272904 sequence *)
A357745
Numbers on the 8 main spokes of a square spiral with 1 in the center.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 21, 23, 25, 28, 31, 34, 37, 40, 43, 46, 49, 53, 57, 61, 65, 69, 73, 77, 81, 86, 91, 96, 101, 106, 111, 116, 121, 127, 133, 139, 145, 151, 157, 163, 169, 176, 183, 190, 197, 204, 211, 218, 225, 233, 241, 249, 257, 265, 273
Offset: 1
See visualization in links.
- Karl-Heinz Hofmann, Table of n, a(n) for n = 1..10000
- Karl-Heinz Hofmann, Visualization of the first few terms
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,1,-2,1).
-
Rest@ CoefficientList[Series[x (1 - x^8 + x^9)/((1 - x)^3*(1 + x) (1 + x^2) (1 + x^4)), {x, 0, 63}], x] (* Michael De Vlieger, Dec 29 2022 *)
a[n_] := BitShiftRight[(n + 3)^2, 4] + Boole[BitAnd[n, 7] != 1]; Array[a, 65] (* Amiram Eldar, Dec 30 2022, after the PARI code *)
LinearRecurrence[{2,-1,0,0,0,0,0,1,-2,1},{1,2,3,4,5,6,7,8,9,11},70] (* Harvey P. Dale, Jul 13 2025 *)
-
a(n) = sqr(n+3)>>4 + (bitand(n,7)!=1); \\ Kevin Ryde, Dec 30 2022
-
def A357745(n): return ((n+3)**2 >> 4) + 1 if n % 8 != 1 else (n+3)**2 >> 4
A303273
Array T(n,k) = binomial(n, 2) + k*n + 1 read by antidiagonals.
Original entry on oeis.org
1, 1, 1, 1, 2, 2, 1, 3, 4, 4, 1, 4, 6, 7, 7, 1, 5, 8, 10, 11, 11, 1, 6, 10, 13, 15, 16, 16, 1, 7, 12, 16, 19, 21, 22, 22, 1, 8, 14, 19, 23, 26, 28, 29, 29, 1, 9, 16, 22, 27, 31, 34, 36, 37, 37, 1, 10, 18, 25, 31, 36, 40, 43, 45, 46, 46, 1, 11, 20, 28, 35, 41
Offset: 0
The array T(n,k) begins
1 1 1 1 1 1 1 1 1 1 1 1 1 ... A000012
1 2 3 4 5 6 7 8 9 10 11 12 13 ... A000027
2 4 6 8 10 12 14 16 18 20 22 24 26 ... A005843
4 7 10 13 16 19 22 25 28 31 34 37 40 ... A016777
7 11 15 19 23 27 31 35 39 43 47 51 55 ... A004767
11 16 21 26 31 36 41 46 51 56 61 66 71 ... A016861
16 22 28 34 40 46 52 58 64 70 76 82 88 ... A016957
22 29 36 43 50 57 64 71 78 85 92 99 106 ... A016993
29 37 45 53 61 69 77 85 93 101 109 117 125 ... A004770
37 46 55 64 73 82 91 100 109 118 127 136 145 ... A017173
46 56 66 76 86 96 106 116 126 136 146 156 166 ... A017341
56 67 78 89 100 111 122 133 144 155 166 177 188 ... A017401
67 79 91 103 115 127 139 151 163 175 187 199 211 ... A017605
79 92 105 118 131 144 157 170 183 196 209 222 235 ... A190991
...
The inverse binomial transforms of the columns are
1 1 1 1 1 1 1 1 1 1 1 1 1 ...
0 1 2 3 4 5 6 7 8 9 10 11 12 ...
1 1 1 1 1 1 1 1 1 1 1 1 1 ...
0 0 0 0 0 0 0 0 0 0 0 0 0 ...
0 0 0 0 0 0 0 0 0 0 0 0 0 ...
0 0 0 0 0 0 0 0 0 0 0 0 0 ...
...
T(k,n-k) = A087401(n,k) + 1 as triangle
1
1 1
1 2 2
1 3 4 4
1 4 6 7 7
1 5 8 10 11 11
1 6 10 13 15 16 16
1 7 12 16 19 21 22 22
1 8 14 19 23 26 28 29 29
1 9 16 22 27 31 34 36 37 37
1 10 18 25 31 36 40 43 45 46 46
...
- R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics: A Foundation for Computer Science, Addison-Wesley, 1994.
-
T := (n, k) -> binomial(n, 2) + k*n + 1;
for n from 0 to 20 do seq(T(n, k), k = 0 .. 20) od;
-
Table[With[{n = m - k}, Binomial[n, 2] + k n + 1], {m, 0, 11}, {k, m, 0, -1}] // Flatten (* Michael De Vlieger, Apr 21 2018 *)
-
T(n, k) := binomial(n, 2)+ k*n + 1$
for n:0 thru 20 do
print(makelist(T(n, k), k, 0, 20));
-
T(n,k) = binomial(n, 2) + k*n + 1;
tabl(nn) = for (n=0, nn, for (k=0, nn, print1(T(n, k), ", ")); print); \\ Michel Marcus, May 17 2018
Comments