A080335
Diagonal in square spiral or maze arrangement of natural numbers.
Original entry on oeis.org
1, 5, 9, 17, 25, 37, 49, 65, 81, 101, 121, 145, 169, 197, 225, 257, 289, 325, 361, 401, 441, 485, 529, 577, 625, 677, 729, 785, 841, 901, 961, 1025, 1089, 1157, 1225, 1297, 1369, 1445, 1521, 1601, 1681, 1765, 1849, 1937, 2025, 2117, 2209, 2305, 2401, 2501
Offset: 0
-
[(3+4*n+2*n^2-(-1)^n)/2: n in [0..50]]; // Vincenzo Librandi, Sep 06 2011
-
A080335:=n->(n mod 2) + (n+1)^2; seq(A080335(k),k=0..49); # Wesley Ivan Hurt, Oct 10 2013
-
With[{nn = 60}, Riffle[Range[1, nn, 2]^2, 4 Range[nn]^2 + 1]] (* Harvey P. Dale, Jan 29 2012 *)
LinearRecurrence[{2, 0, -2, 1}, {1, 5, 9, 17}, 60] (* Harvey P. Dale, Jan 29 2012 *)
Table[(3 + 4 n + 2 n^2 - (-1)^n)/2, {n, 0, 50}] (* Wesley Ivan Hurt, Oct 10 2013 *)
Table[Mod[n, 2] + (n + 1)^2, {n, 0, 20}] (* Eric W. Weisstein, Jan 31 2024 *)
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).
A267682
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3, with initial terms 1, 1, 4, 8.
Original entry on oeis.org
1, 1, 4, 8, 15, 23, 34, 46, 61, 77, 96, 116, 139, 163, 190, 218, 249, 281, 316, 352, 391, 431, 474, 518, 565, 613, 664, 716, 771, 827, 886, 946, 1009, 1073, 1140, 1208, 1279, 1351, 1426, 1502, 1581, 1661, 1744, 1828, 1915, 2003, 2094, 2186, 2281, 2377, 2476
Offset: 0
- S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
-
rule=201; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) nbc=Table[Total[catri[[k]]],{k,1,rows}]; (* Number of Black cells in stage n *) Table[Total[Take[nbc,k]],{k,1,rows}] (* Number of Black cells through stage n *)
LinearRecurrence[{2, 0, -2, 1}, {1, 1, 4, 8}, 60] (* Vincenzo Librandi, Jan 19 2016 *)
-
Vec((1-x+2*x^2+2*x^3)/((1-x)^3*(1+x)) + O(x^100)) \\ Colin Barker, Jan 19 2016
-
print([n*(n-1)+n//2+1 for n in range(51)]) # Karl V. Keller, Jr., Jul 14 2021
A346864
Irregular triangle read by rows in which row n lists the row A014105(n) of A237591, n >= 1.
Original entry on oeis.org
2, 1, 6, 2, 1, 1, 11, 4, 3, 1, 1, 1, 19, 6, 4, 2, 2, 1, 1, 1, 28, 10, 5, 3, 3, 2, 1, 1, 1, 1, 40, 13, 7, 5, 3, 2, 2, 2, 1, 1, 1, 1, 53, 18, 10, 5, 4, 3, 3, 2, 1, 2, 1, 1, 1, 1, 69, 23, 12, 7, 5, 4, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 86, 29, 15, 9, 6, 5, 4, 2, 3, 2, 2, 1, 2, 1, 1, 1, 1, 1
Offset: 1
Triangle begins:
2, 1;
6, 2, 1, 1;
11, 4, 3, 1, 1, 1;
19, 6, 4, 2, 2, 1, 1, 1;
28, 10, 5, 3, 3, 2, 1, 1, 1, 1;
40, 13, 7, 5, 3, 2, 2, 2, 1, 1, 1, 1;
53, 18, 10, 5, 4, 3, 3, 2, 1, 2, 1, 1, 1, 1;
69, 23, 12, 7, 5, 4, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1;
86, 29, 15, 9, 6, 5, 4, 2, 3, 2, 2, 1, 2, 1, 1, 1, 1, 1;
...
Illustration of initial terms:
Column h gives the n-th second hexagonal number (A014105).
Column S gives the sum of the divisors of the second hexagonal numbers which equals the area (and the number of cells) of the associated diagram.
--------------------------------------------------------------------------------------
n h S Diagram
--------------------------------------------------------------------------------------
_ _ _ _
| | | | | | | |
_ _|_| | | | | | |
1 3 4 |_ _|1 | | | | | |
2 | | | | | |
_ _| | | | | |
| _ _| | | | |
_ _|_| | | | |
| _|1 | | | |
_ _ _ _ _| | 1 | | | |
2 10 18 |_ _ _ _ _ _|2 | | | |
6 _ _ _ _|_| | |
| | | |
_| | | |
| _| | |
_ _|_| | |
_ _| _|1 | |
|_ _ _|1 1 | |
| 3 _ _ _ _ _ _ _| |
|4 | _ _ _ _ _ _|
_ _ _ _ _ _ _ _ _ _ _| | |
3 21 32 |_ _ _ _ _ _ _ _ _ _ _| _ _| |
11 | |
_| _ _|
| |
_ _| _|
_ _| _|
| _|1
_ _ _| _ _|1 1
| | 2
| _ _ _ _|2
| | 4
| |
| |6
| |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
4 36 91 |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
19
.
-
row(n) = my(m=n*(2*n + 1)); vector((sqrtint(8*m+1)-1)\2, k, ceil((m+1)/k - (k+1)/2) - ceil((m+1)/(k+1) - (k+2)/2)); \\ Michel Marcus, Jan 12 2025
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
A317187
Arrange primes along the square spiral; sequence lists primes on the X-axis.
Original entry on oeis.org
2, 3, 13, 31, 67, 107, 173, 241, 347, 443, 577, 709, 877, 1049, 1249, 1471, 1697, 1973, 2243, 2539, 2833, 3191, 3541, 3911, 4289, 4729, 5179, 5651, 6131, 6637, 7159, 7699, 8293, 8867, 9473, 10133, 10799, 11503, 12251, 12941, 13709, 14537, 15289
Offset: 1
- David James Sycamore, Posting to Sequence Fans Mailing List, Jul 24 2018
A381703
Irregular triangle read by rows in which every row of length A071764(n) lists A(n,w,h) = the number of free polyominoes of size n, width w and height h (for w <= h, and all possible w,h pairs).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 3, 1, 2, 3, 6, 1, 1, 6, 5, 7, 15, 1, 2, 11, 5, 7, 39, 25, 18, 1, 1, 10, 19, 7, 3, 59, 96, 35, 77, 61, 1, 3, 22, 28, 7, 1, 42, 210, 188, 49, 181, 383, 97, 73, 1, 1, 15, 52, 40, 9, 21, 255, 550, 332, 63, 266, 1304, 822, 155, 529, 240, 1, 3, 45, 90, 53, 9, 4, 212, 954, 1231, 529, 81, 251, 2847, 3548, 1551, 220, 2413, 2366, 410, 255
Offset: 1
Triangle begins:
n
1: 1
2: 1
3: 1 1
4: 1 1 3
5: 1 2 3 6
6: 1 1 6 5 7 15
7: 1 2 11 5 7 39 25 18
8: 1 1 10 19 7 3 59 96 35 77 61
9: 1 3 22 28 7 1 42 210 188 49 181 383 97 73
10: 1 1 15 52 40 9 21 255 550 332 63 266 1304 822 155 529 240
...
Any row contains an irregular array that shows the number of polyominoes having width w and height h. E.g., row 6 contains the array:
h/w 1 2 3
1
2
3 1 7
4 6 15
5 5
6 1
.
There are 5 polyominoes of size 6 with width 2 and height 5, so A(6,2,5)=5:
.
OO O O O O
O OO O O O
O O OO O OO
O O O OO O
O O O O O
A309573
a(n) is the sum of lattice points enumerated by the square number spiral falling on the circumference of circles centered at the origin of radii n.
Original entry on oeis.org
0, 16, 64, 144, 256, 912, 576, 784, 1024, 1296, 3648, 1936, 2304, 7312, 3136, 8208, 4096, 11824, 5184, 5776, 14592, 7056, 7744, 8464, 9216, 41232, 29248, 11664, 12544, 27568, 32832, 15376, 16384, 17424, 47296, 44688, 20736, 61104, 23104, 65808, 58368, 78096, 28224, 29584, 30976, 73872
Offset: 0
16 is a term because 16 = 16*(1)^2.
912 is a term because 912 = 16*(5)^2 + (2*(16*(4)^2)).
41232 is a term because 41232 = 16*(25)^2 + (2*((16*(24)^2) + (16*(20)^2))).
-
Tb(n) = {return(16 * n * n)}
llsum(n) = {my(x=0); for (i = 1, n - 2, for (ii = i+1, n - 1, if(n*n == (ii*ii) + (i*i), x+=(2 * Tb(ii))))); return(x)}
Tx(n) = {my(x=0); forprimestep(x = 5, n, 4, if(n%x==0, return(llsum(n))))}
Tn(n) = {for (i = 0, n, print1(Tb(i) + Tx(i), ", "))}
Tn(45)
A317612
For k >= 1, fill a k X k square with the numbers 1 to k^2 by rows left to right and top to bottom; then read the square by a square clockwise spiral beginning at the top left and spiraling inwards.
Original entry on oeis.org
1, 1, 2, 4, 3, 1, 2, 3, 6, 9, 8, 7, 4, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10, 1, 2, 3, 4, 5, 10, 15, 20, 25, 24, 23, 22, 21, 16, 11, 6, 7, 8, 9, 14, 19, 18, 17, 12, 13, 1, 2, 3, 4, 5, 6, 12, 18, 24, 30, 36, 35, 34, 33, 32, 31, 25, 19, 13, 7, 8, 9, 10, 11, 17, 23, 29, 28, 27, 26, 20, 14, 15, 16, 22, 21, 1, 2, 3, 4, 5, 6, 7, 14, 21, 28, 35, 42, 49, 48, 47, 46, 45, 44, 43
Offset: 1
1 => 1;
.
1---2
|
3---4 => 1, 2, 4, 3;
.
1---2---3
|
4---5 6
| |
7---8---9 => 1, 2, 3, 6, 9, 8, 7, 4, 5;
.
1---2---3---4
|
5---6---7 8
| | |
9 10--11 12
| |
13--14--15--16
.
=> 1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10;
.
1---2---3---4---5
|
6---7---8---9 10
| | |
11 12--13 14 15
| | | |
16 17--18--19 20
| |
21--22--23--24--25
.
=> 1, 2, 3, 4, 5, 10, 15, 20, 25, 24, 23, 22, 21, 16, 11, 6, 7, 8, 9, 14, 19, 18, 17, 12, 13;
.
1---2---3---4---5---6
|
7---8---9--10--11 12
| | |
13 14--15--16 17 18
| | | | |
19 20 21--22 23 24
| | | |
25 26--27--28--29 30
| |
31--32--33--34--35--36
.
=> 1, 2, 3, 4, 5, 6, 12, 18, 24, 30, 36, 35, 34, 33, 32, 31, 25, 19, 13, 7, 8, 9, 10, 11, 17, 23, 29, 28, 27, 26, 20, 14, 15, 16, 22, 21;
-
(* To form an n X n square table which begins left to right, then top to bottom *) a[i_, j_, n_] := j + n*(i - 1); f[n_] := Table[ a[i, j, n], {i, n}, {j, n}]
Comments