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).
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 *)
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
A054555
Prime number spiral (clockwise, East spoke).
Original entry on oeis.org
2, 7, 47, 139, 283, 503, 797, 1151, 1579, 2089, 2689, 3361, 4099, 4967, 5861, 6883, 8011, 9199, 10457, 11903, 13313, 14887, 16547, 18269, 20161, 22091, 24083, 26297, 28573, 30941, 33347, 35899, 38593, 41299, 44111, 47149, 50131, 53327, 56597
Offset: 0
Begin a prime number spiral at shell 0 (prime 2), proceed clockwise, East.
From _Omar E. Pol_, Feb 19 2022: (Start)
The spiral with four terms in every spoke looks like this:
.
227 101--103--107--109--113--127
| | |
223 97 29---31---37---41 131
| | | | |
211 89 23 3----5 43 137
| | | | | | |
199 83 19 2 7 47 139
| | | | | |
197 79 17---13---11 53 149
| | | |
193 73---71---67---61---59 151
| |
191--181--179--173--167--163--157
.
(End)
A168023
Noncomposite numbers in the northern ray of the Ulam spiral as oriented on the March 1964 cover of Scientific American.
Original entry on oeis.org
1, 61, 139, 1009, 1279, 2281, 3109, 3571, 4591, 6361, 8419, 13399, 14341, 17359, 19531, 23029, 35251, 39901, 44839, 46549, 51871, 55579, 61381, 73849, 76039, 102241, 110059, 135241, 153469, 156619
Offset: 1
Cf.
A054556, all numbers of the form 4n^2 - 9n + 6. Noncomposites of the eastern ray are in
A168022. Primes of the northeastern ray are in
A073337. Noncomposites of the northwestern ray are in
A168024. Noncomposites of the western ray are in
A168025. Noncomposites of the southwestern ray are in
A168026. Noncomposites of the southern ray are in
A168027.
A266883
Numbers of the form m*(4*m+1)+1, where m = 0,-1,1,-2,2,-3,3,...
Original entry on oeis.org
1, 4, 6, 15, 19, 34, 40, 61, 69, 96, 106, 139, 151, 190, 204, 249, 265, 316, 334, 391, 411, 474, 496, 565, 589, 664, 690, 771, 799, 886, 916, 1009, 1041, 1140, 1174, 1279, 1315, 1426, 1464, 1581, 1621, 1744, 1786, 1915, 1959, 2094, 2140, 2281, 2329, 2476, 2526
Offset: 0
Cf.
A002061: m*(4*m+2)+1 for m = 0,0,-1,1,-2,2,-3,3, ...
Cf.
A174114: m*(4*m+3)+1 for m = 0,-1,1,-2,2,-3,3,-4,4, ...
Cf.
A054556: m*(4*m+1)+1 for nonpositive m.
Cf.
A054567: m*(4*m+1)+1 for nonnegative m.
Cf.
A074378: numbers m such that 16*m+1 is a square.
-
[n*(n+1)+1-((2*n+1)*(-1)^n-1)/4: n in [0..50]];
-
I:=[1,4,6,15,19]; [n le 5 select I[n] else Self(n-1) + 2*Self(n-2) -2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jan 06 2016
-
Table[n (n + 1) + 1 - ((2 n + 1) (-1)^n - 1)/4, {n, 0, 50}]
LinearRecurrence[{1, 2, -2, -1, 1}, {1, 4, 6, 15, 19}, 60] (* Vincenzo Librandi, Jan 06 2016 *)
-
vector(50, n, n--; n*(n+1)+1-((2*n+1)*(-1)^n-1)/4)
-
Vec((1+3*x+3*x^3+x^4)/((1+x)^2*(1-x)^3) + O(x^100)) \\ Altug Alkan, Jan 06 2016
-
[n*(n+1)+1-((2*n+1)*(-1)**n-1)/4 for n in range(60)]
-
[n*(n+1)+1-((2*n+1)*(-1)^n-1)/4 for n in range(50)]
A365673
Array A(n, k) read by ascending antidiagonals. Polygonal number weighted generalized Catalan sequences.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 4, 15, 8, 1, 1, 1, 5, 34, 105, 16, 1, 1, 1, 6, 61, 496, 945, 32, 1, 1, 1, 7, 96, 1385, 11056, 10395, 64, 1, 1, 1, 8, 139, 2976, 50521, 349504, 135135, 128, 1, 1, 1, 9, 190, 5473, 151416, 2702765, 14873104, 2027025, 256, 1
Offset: 0
Array A(n, k) starts: (polygon|diagonal|triangle)
[0] 1, 1, 1, 1, 1, 1, 1, ... A258837 A000012
[1] 1, 1, 2, 4, 8, 16, 32, ... A080956 A011782
[2] 1, 1, 3, 15, 105, 945, 10395, ... A001477 A001147 A001498
[3] 1, 1, 4, 34, 496, 11056, 349504, ... A000217 A002105 A365674
[4] 1, 1, 5, 61, 1385, 50521, 2702765, ... A000290 A000364 A060058
[5] 1, 1, 6, 96, 2976, 151416, 11449296, ... A000326 A126151 A366138
[6] 1, 1, 7, 139, 5473, 357721, 34988647, ... A000384 A126156 A365672
[7] 1, 1, 8, 190, 9080, 725320, 87067520, ... A000566 A366150 A366149
[8] 1, 1, 9, 249, 14001, 1322001, 188106489, ... A000567
A054556 A366137
-
poly := (s, n) -> ((s - 2) * n^2 - (s - 4) * n) / 2:
T := proc(s, n, k) option remember; if k = 0 then 1 else if k = n then T(s, n, k-1) else poly(s, n - k + 1) * T(s, n, k - 1) + T(s, n - 1, k) fi fi end:
for n from 0 to 8 do A := (n, k) -> T(n, k, k): seq(A(n, k), k = 0..9) od;
# Alternative, using continued fractions:
A := proc(p, L) local CF, poly, k, m, P, ser;
poly := (s, n) -> ((s - 2)*n^2 - (s - 4)*n)/2;
CF := 1 + x;
for k from 1 to L do
m := L - k + 1;
P := poly(p, m);
CF := 1/(1 - P*x*CF)
od;
ser := series(CF, x, L);
seq(coeff(ser, x, m), m = 0..L-1)
end:
for p from 0 to 8 do lprint(A(p, 8)) od;
-
poly[s_, n_] := ((s - 2) * n^2 - (s - 4) * n) / 2;
T[s_, n_, k_] := T[s, n, k] = If[k == 0, 1, If[k == n, T[s, n, k - 1], poly[s, n - k + 1] * T[s, n, k - 1] + T[s, n - 1, k]]];
A[n_, k_] := T[n, k, k];
Table[A[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 27 2023, from first Maple program *)
-
A(p, n) = {
my(CF = 1 + x,
poly(s, n) = ((s - 2)*n^2 - (s - 4)*n)/2,
m, P
);
for(k = 1, n,
m = n - k + 1;
P = poly(p, m);
CF = 1/(1 - P*x*CF)
);
Vec(CF + O(x^(n)))
}
for(p = 0, 8, print(A(p, 8)))
\\ Michel Marcus and Peter Luschny, Oct 02 2023
-
from functools import cache
@cache
def T(s, n, k):
if k == 0: return 1
if k == n: return T(s, n, k - 1)
p = (n - k + 1) * ((s - 2) * (n - k + 1) - (s - 4)) // 2
return p * T(s, n, k - 1) + T(s, n - 1, k)
def A(n, k): return T(n, k, k)
for n in range(9): print([A(n, k) for k in range(9)])
A143861
Ulam's spiral (NNE spoke).
Original entry on oeis.org
1, 14, 59, 136, 245, 386, 559, 764, 1001, 1270, 1571, 1904, 2269, 2666, 3095, 3556, 4049, 4574, 5131, 5720, 6341, 6994, 7679, 8396, 9145, 9926, 10739, 11584, 12461, 13370, 14311, 15284, 16289, 17326, 18395, 19496, 20629, 21794, 22991, 24220
Offset: 1
- Chris K. Caldwell & G. L. Honaker, Jr., Prime Curios! The Dictionary of Prime Number Trivia, CreateSpace, Sept 2009, pp. 2-3.
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Martin Gardner, Mathematical Recreations: The Remarkable Lore of the Prime Number, Scientific American 210 3: 120 - 128.
- Hermetic Systems, Prime Number Spiral
- OEIS wiki, Ulam spiral
- Ivars Peterson's MathTrek, Prime Spirals, Science News, May 3 2002.
- Robert Sacks, Number Spiral
- Scientific American, Cover page of the March 1964
- Eric Weisstein's World of Mathematics, Prime Spiral
- Wikipedia, Ulam spiral
- Wikipedia, Boxing the compass
- Robert G. Wilson v, Ulam's spiral
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Cf.
A016754,
A033638,
A033951,
A053755,
A054552,
A054554,
A054556,
A054567,
A054569,
A073337,
A143838,
A143839,
A143854,
A143855,
A143856,
A143859,
A143860.
-
List([1..40], n-> ((32*n-35)^2 +55)/64); # G. C. Greubel, Nov 09 2019
-
[((32*n-35)^2 +55)/64: n in [1..40]]; // G. C. Greubel, Nov 09 2019
-
seq( ((32*n-35)^2 +55)/64, n=1..40); # G. C. Greubel, Nov 09 2019
-
(* From Robert G. Wilson v, Oct 29 2011 *)
f[n_]:= 16n^2 -35n +20; Array[f, 40]
LinearRecurrence[{3,-3,1}, {1,14,59}, 40]
FoldList[#1 + #2 &, 1, 32Range@ 10 - 19] (* End *)
((32*Range[40] -35)^2 +55)/64 (* G. C. Greubel, Nov 09 2019 *)
-
a(n)=16*n^2-35*n+20 \\ Charles R Greathouse IV, Oct 29 2011
-
[((32*n-35)^2 +55)/64 for n in (1..40)] # G. C. Greubel, Nov 09 2019
Comments