A151403
Number of walks within N^2 (the first quadrant of Z^2) starting at (0,0), ending on the vertical axis and consisting of 2*n steps taken from {(-1, 0), (-1, 1), (1, 0), (1, 1)}.
Original entry on oeis.org
1, 4, 32, 320, 3584, 43008, 540672, 7028736, 93716480, 1274544128, 17611882496, 246566354944, 3489862254592, 49855175065600, 717914520944640, 10409760553697280, 151860036312760320, 2227280532587151360, 32823081532863283200, 485781606686376591360, 7217326727911880785920
Offset: 0
- Richard P. Stanley, Catalan Numbers, Cambridge, 2015, p. 106.
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Mireille Bousquet-Mélou and Marni Mishna, Walks with small steps in the quarter plane, arXiv:0810.4387 [math.CO], 2008-2009.
- Alon Regev, Enumerating Triangulations by Parallel Diagonals, Journal of Integer Sequences, Vol. 15 (2012), Article 12.8.5; arXiv preprint, arXiv:1208.3915 [math.CO], 2012.
-
[4^n * Catalan(n): n in [0..20]]; // Vincenzo Librandi, Oct 24 2012
-
A151403_list := proc(n) local j, a, w; a := array(0..n); a[0] := 1;
for w from 1 to n do a[w] := 4*(a[w-1]+add(a[j]*a[w-j-1],j=1..w-1)) od; convert(a,list) end: A151403_list(20); # Peter Luschny, May 19 2011
seq(4^n*(2*n)!*coeff(series(hypergeom([],[2],x^2),x,2*n+2),x,2*n),n=0..20); # Peter Luschny, Jan 31 2015
-
aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, -1 + j, -1 + n] + aux[-1 + i, j, -1 + n] + aux[1 + i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n]]; Table[Sum[aux[0, k, 2 n], {k, 0, 2 n}], {n, 0, 25}]
-
A151403 = lambda n: 4^n*hypergeometric([1-n,-n],[2],1)
[Integer(A151403(n).n()) for n in range(21)] # Peter Luschny, Sep 22 2014
A005021
Random walks (binomial transform of A006054).
Original entry on oeis.org
1, 5, 19, 66, 221, 728, 2380, 7753, 25213, 81927, 266110, 864201, 2806272, 9112264, 29587889, 96072133, 311945595, 1012883066, 3288813893, 10678716664, 34673583028, 112584429049, 365559363741, 1186963827439, 3854047383798, 12514013318097, 40632746115136
Offset: 0
- W. Feller, An Introduction to Probability Theory and its Applications, 3rd ed, Wiley, New York, 1968, p. 96.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Andrei Asinowski and Michaela A. Polley, Patterns in rectangulations. Part I: T-like patterns, inversion sequence classes I(010, 101, 120, 201) and I(011, 201), and rushed Dyck paths, arXiv:2501.11781 [math.CO], 2025. See p. 26.
- Jean-Luc Baril and Helmut Prodinger, Enumeration of partial Lukasiewicz paths, arXiv:2205.01383 [math.CO], 2022.
- Paul Barry, Centered polygon numbers, heptagons and nonagons, and the Robbins numbers, arXiv:2104.01644 [math.CO], 2021.
- Nachum Dershowitz, Between Broadway and the Hudson: A Bijection of Corridor Paths, arXiv:2006.06516 [math.CO], 2020.
- C. J. Everett and P. R. Stein, The combinatorics of random walk with absorbing barriers, Discrete Math. 17 (1977), no. 1, 27-45.
- C. J. Everett and P. R. Stein, The combinatorics of random walk with absorbing barriers, Discrete Math. 17 (1977), no. 1, 27-45. [Annotated scanned copy]
- G. Kreweras, Sur les éventails de segments, Cahiers du Bureau Universitaire de Recherche Opérationnelle, Institut de Statistique, Université de Paris, #15 (1970), 3-41. [Annotated scanned copy]
- S. Morier-Genoud, V. Ovsienko and S. Tabachnikov, 2-frieze patterns and the cluster structure of the space of polygons, Annales de l'institut Fourier, 62 no. 3 (2012), 937-987; arXiv:1008.3359 [math.AG], 2010-2011. - From _N. J. A. Sloane_, Dec 26 2012
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
- N. J. A. Sloane, Transforms
- László Németh and László Szalay, Sequences Involving Square Zig-Zag Shapes, J. Int. Seq., Vol. 24 (2021), Article 21.5.2.
- Roman Witula, Damian Slota and Adam Warzynski, Quasi-Fibonacci Numbers of the Seventh Order, J. Integer Seq., 9 (2006), Article 06.4.3.
- Index entries for linear recurrences with constant coefficients, signature (5,-6,1).
-
I:=[1,5,19]; [n le 3 select I[n] else 5*Self(n-1)-6*Self(n-2)+Self(n-3): n in [1..30]]; // Vincenzo Librandi, Sep 18 2015
-
a:=k->sum(binomial(5+2*k,7*j+k-2),j=ceil((2-k)/7)..floor((7+k)/7))-sum(binomial(5+2*k,7*j+k-1),j=ceil((1-k)/7)..floor((6+k)/7)): seq(a(k),k=0..25);
A005021:=-(z-1)*(z-5)/(-1+5*z-6*z**2+z**3); # conjectured by Simon Plouffe in his 1992 dissertation; gives sequence apart from the initial 1
-
LinearRecurrence[{5,-6,1}, {1,5,19}, 50] (* Roman Witula, Aug 09 2012 *)
CoefficientList[Series[1/(1 - 5 x + 6 x^2 - x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 18 2015 *)
-
x='x+O('x^30); Vec(1/(1-5*x+6*x^2-x^3)) \\ G. C. Greubel, Apr 19 2018
A120443
Number of (undirected) Hamiltonian paths in the n X n grid graph.
Original entry on oeis.org
1, 4, 20, 276, 4324, 229348, 13535280, 3023313284, 745416341496, 730044829512632, 786671485270308848, 3452664855804347354220, 16652005717670534681315580, 331809088406733654427925292528, 7263611367960266490262600117251524
Offset: 1
From _Robert FERREOL_, Apr 03 2019: (Start)
a(3) = 20:
there are 4 paths similar to
+ - + - +
|
+ - + - +
|
+ - + - +
8 paths similar to
+ - + - +
| |
+ + - +
| |
+ + - +
and 8 paths similar to
+ - + - +
| |
+ + +
| | |
+ + - +
(End)
- Jesper L. Jacobsen, Table of n, a(n) for n = 1..17
- J. L. Jacobsen, Exact enumeration of Hamiltonian circuits, walks and chains in two and three dimensions, J. Phys. A: Math. Theor. 40 (2007) 14667-14678.
- J.-M. Mayer, C. Guez and J. Dayantis, Exact computer enumeration of the number of Hamiltonian paths in small square plane lattices, Physical Review B, Vol. 42 Number 1, 1990.
- Eric Weisstein's World of Mathematics, Grid Graph
- Eric Weisstein's World of Mathematics, Hamiltonian Path
- Index entries for sequences related to graphs, Hamiltonian
More terms from Jesper L. Jacobsen (jesper.jacobsen(AT)u-psud.fr), Dec 12 2007
A208615
Number of Young tableaux A(n,k) with n k-length rows, increasing entries down the columns and monotonic entries along the rows (first row increasing); square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 6, 10, 1, 1, 1, 1, 15, 53, 35, 1, 1, 1, 1, 43, 491, 587, 126, 1, 1, 1, 1, 133, 6091, 25187, 7572, 462, 1, 1, 1, 1, 430, 87781, 1676707, 1725819, 109027, 1716, 1, 1, 1, 1, 1431, 1386529, 140422657, 705002611, 144558247, 1705249, 6435, 1, 1
Offset: 0
A(2,3) = 6:
+---+ +---+ +---+ +---+ +---+ +---+
|123| |123| |124| |125| |134| |135|
|456| |654| |356| |346| |256| |246|
+---+---+ +---+---+ +---+---+ +---+---+ +---+---+ +---+---+
|x |100| |x |100| |x |100| |x |100| |x |100| |x |100|
| x |110| | x |110| | x |110| | x |110| |x |200| |x |200|
| x|111| | x|111| |x |210| |x |210| | x |210| | x |210|
|x |211| | x|112| | x|211| | x |220| | x|211| | x |220|
| x |221| | x |122| | x |221| | x|221| | x |221| | x|221|
| x|222| |x |222| | x|222| | x|222| | x|222| | x|222|
+---+---+ +---+---+ +---+---+ +---+---+ +---+---+ +---+---+
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, ...
1, 1, 3, 6, 15, 43, 133, ...
1, 1, 10, 53, 491, 6091, 87781, ...
1, 1, 35, 587, 25187, 1676707, 140422657, ...
1, 1, 126, 7572, 1725819, 705002611, 396803649991, ...
1, 1, 462, 109027, 144558247, 398084427253, 1672481205752413, ...
Rows 0+1, 2-10 give:
A000012,
A141351 (for n>1),
A208616,
A208617,
A208618,
A208619,
A208620,
A208621,
A208622,
A208623.
Columns 0+1, 2-10 give:
A000012,
A088218,
A185148,
A208624,
A208625,
A208626,
A208627,
A208628,
A208629,
A208630.
-
b:= proc() option remember;
`if`(nargs<2, 1, `if`(args[1]=args[nargs],
`if`(args[1]=0, 1, 2* b(args[1]-1, seq(args[i], i=2..nargs))),
`if`(args[1]>0, b(args[1]-1, seq(args[i], i=2..nargs)), 0)
+add(`if`(args[j]>args[j-1], b(seq(args[i] -`if`(i=j, 1, 0)
, i=1..nargs)), 0), j=2..nargs) ))
end:
A:= (n, k)-> `if`(n=0 or k=0, 1, b(n-1, n$(k-1))):
seq(seq(A(n, d-n), n=0..d), d=0..12);
-
b[args__] := b[args] = If[(nargs = Length[{args}]) < 2, 1, If[First[{args}] == Last[{args}], If[First[{args}] == 0, 1, 2*b[First[{args}]-1, Sequence @@ Rest[{args}]]], If[First[{args}] > 0, b[First[{args}]-1, Sequence @@ Rest[{args}]], 0] + Sum [If[{args}[[j]] > {args}[[j-1]], b[Sequence @@ Table[{args}[[i]] - If[i == j, 1, 0], {i, 1, nargs}]], 0], {j, 2, nargs}] ] ]; a[n_, k_] := If[n == 0 || k == 0, 1, b[n-1, Sequence @@ Array[n&, k-1]]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Dec 12 2013, translated from Maple *)
A332767
The squares visited on the 2D square (Ulam) spiral when starting at square 1 and then stepping to the closest unvisited square which contains a composite number. If two or more squares are the same distance from the current square then the one with the smallest composite number is chosen.
Original entry on oeis.org
1, 4, 15, 14, 33, 32, 30, 55, 54, 87, 86, 85, 52, 27, 10, 9, 8, 6, 18, 39, 38, 36, 35, 16, 34, 60, 95, 94, 93, 58, 57, 56, 88, 129, 128, 177, 176, 175, 126, 125, 84, 51, 26, 25, 24, 46, 45, 22, 21, 20, 40, 69
Offset: 1
a(2) = 4 as the starting square numbered 1 has three adjacent squares 1 unit away with numbers 4,6,8, and 4 is the smallest number of those.
a(4) = 14 as the previous visited square 15 has three unvisited adjacent composite number 14,16,34, and 14 is the smallest number of those.
a(7) = 30 as the previous number 32 is has three primes and one visited composite square one unit away. The next closest unvisited composites, sqrt(2) units away, are 30,58,60, and 30 is the smallest of those.
- Scott R. Shannon, Illustration of a section of the walk up to n = 450. This shows how the square with number 12, which has four adjacent primes 1 unit away, is not visited during the initial part of the walk. Various other unvisited composites can also be seen.
- Scott R. Shannon, Illustration of the walk up to n = 1000000. The color of each step is graduated across the spectrum from red to violet to show the relative visit order of the squares. The starting square is shown as a white dot and the smallest unvisited composite square with number 12 is shown as a yellow dot. Note the walk steps shown in yellow which make a detour toward the central squares after about 150,000 steps. Click on the image to zoom in.
- Wikipedia, Ulam Spiral.
A005566
Number of walks of length n on square lattice, starting at origin, staying in first quadrant.
Original entry on oeis.org
1, 2, 6, 18, 60, 200, 700, 2450, 8820, 31752, 116424, 426888, 1585584, 5889312, 22084920, 82818450, 312869700, 1181952200, 4491418360, 17067389768, 65166397296, 248817153312, 953799087696, 3656229836168, 14062422446800, 54086240180000, 208618354980000
Offset: 0
G.f. = 1 + 2*x + 6*x^2 + 18*x^3 + 60*x^4 + 200*x^5 + 700*x^6 + 2450*x^7 + ... - _Michael Somos_, Oct 17 2019
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Alin Bostan, Computer Algebra for Lattice Path Combinatorics, Seminaire de Combinatoire Ph. Flajolet, March 28 2013.
- Alin Bostan, Calcul Formel pour la Combinatoire des Marches [The text is in English], Habilitation à Diriger des Recherches, Laboratoire d'Informatique de Paris Nord, Université Paris 13, December 2017.
- Alin Bostan, Frédéric Chyzak, Mark van Hoeij, Manuel Kauers, and Lucien Pech, Hypergeometric expressions for generating functions of walks with small steps in the quarter plane. Eur. J. Comb. 61, 242-275 (2017)
- R. K. Guy, Letter to N. J. A. Sloane, May 1990
- R. K. Guy, Catwalks, sandsteps and Pascal pyramids, J. Integer Sequences, Vol. 3 (2000), Article #00.1.6.
-
[Binomial(n, Floor(n/2))*Binomial(n+1, Floor((n+1)/2)): n in [0..30]]; // Vincenzo Librandi, Feb 18 2015
-
f[n_] := Binomial[n, Floor[n/2]] Binomial[n + 1, Floor[(n + 1)/2]]; Array[f, 25, 0] (* Robert G. Wilson v *)
A010566
Number of 2n-step 2-dimensional closed self-avoiding paths on square lattice.
Original entry on oeis.org
0, 8, 24, 112, 560, 2976, 16464, 94016, 549648, 3273040, 19781168, 121020960, 748039552, 4664263744, 29303071680, 185307690240, 1178635456752, 7535046744864, 48392012257184, 312061600211680, 2019822009608592, 13117263660884768, 85447982919036736
Offset: 1
- B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 461.
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- Felix A. Pahl, Table of n, a(n) for n = 1..55 (from Iwan Jensen's computations of A002931, using a(n)=4n*A002931(n))
- M. E. Fisher and D. S. Gaunt, Ising model and self-avoiding walks on hypercubical lattices and high density expansions, Phys. Rev. 133 (1964) A224-A239.
- M. E. Fisher and M. F. Sykes, Excluded-volume problem and the Ising model of ferromagnetism, Phys. Rev. 114 (1959), 45-58.
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 364.
- A. J. Guttmann and I. G. Enting, The size and number of rings on the square lattice, J. Phys. A 21 (1988), L165-L172.
- Brian Hayes, How to avoid yourself, American Scientist 86 (1998) 314-319.
- B. J. Hiley and M. F. Sykes, Probability of initial ring closure in the restricted random-walk model of a macromolecule, J. Chem. Phys., 34 (1961), 1531-1537.
- Iwan Jensen, Series Expansions for Self-Avoiding Walks
- G. S. Rushbrooke and J. Eve, On Noncrossing Lattice Polygons, Journal of Chemical Physics, 31 (1959), 1333-1334.
-
A002931 = Cases[Import["https://oeis.org/A002931/b002931.txt", "Table"], {, }][[All, 2]]; a[n_] := 4n A002931[[n]];
a /@ Range[55] (* Jean-François Alcover, Jan 11 2020 *)
-
# Alex Nisnevich, Jul 22 2023
def num_continuations(path, dist):
(x, y) = path[-1]
next = [(x+1, y), (x-1, y), (x, y+1), (x, y-1)]
if dist == 1:
return (0, 0) in next
else:
return sum(num_continuations(path + [c], dist - 1) for c in next if c not in path)
def A010566(n):
return 4 * num_continuations([(0, 0), (1, 0)], 2 * n - 1) if n >= 2 else 0
A054474
Number of walks on square lattice that start and end at origin after 2n steps, not touching origin at intermediate stages.
Original entry on oeis.org
1, 4, 20, 176, 1876, 22064, 275568, 3584064, 47995476, 657037232, 9150655216, 129214858304, 1845409805168, 26606114089024, 386679996988736, 5658611409163008, 83302885723872852, 1232764004638179504, 18327520881735288432, 273595871825723062848
Offset: 0
Alessandro Zinani (alzinani(AT)tin.it), May 19 2000
a(5)=22064, i.e., there are 22064 different walks (on a square lattice) that start and end at the origin after 2*5=10 steps, avoiding the origin at intermediate steps.
- S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 322-331.
-
b:= proc(n) b(n):= binomial(2*n, n)^2 end:
a:= proc(n) option remember;
b(n)-add(a(n-i)*b(i), i=1..n-1)
end:
seq(a(n), n=0..21); # Alois P. Heinz, Dec 05 2023
-
m = 18; gf[x_] = 2 - Pi/(2*EllipticK[4*Sqrt[x]]); (List @@ Normal[ Series[ gf[x], {x, 0, m-1}]] /. x -> 1)[[1 ;; m+1]]*Table[4^k, {k, 0, m}] (* Jean-François Alcover, Jun 16 2011, after Vladeta Jovovic *)
CoefficientList[Series[2-Pi/(2*EllipticK[16*x]),{x,0,20}],x] (* Vaclav Kotesovec, Mar 10 2014 *)
CoefficientList[Series[2-ArithmeticGeometricMean[1,Sqrt[1-16x]],{x,0,20}],x] (* Thomas Dybdahl Ahle, Oct 30 2023 *)
-
a(n)=if(n<0,0,polcoeff(2-agm(1,sqrt(1-16*x+x*O(x^n))),n))
A173380
Number of n-step walks on square lattice (no points repeated, no adjacent points unless consecutive in path).
Original entry on oeis.org
1, 4, 12, 28, 68, 164, 396, 940, 2244, 5324, 12668, 29940, 71012, 167468, 396172, 932628, 2201636, 5175268, 12195660, 28632804, 67374292, 158017740, 371354012, 870197548, 2042809996, 4783292988, 11218303476, 26250429540, 61514573604, 143857013260, 336865512780, 787374453524, 1842579846180
Offset: 0
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Scott R. Shannon, Table of n, a(n) for n = 0..35
- D. Bennett-Wood, I. G. Enting, D. S. Gaunt, A. J. Guttmann, J. L. Leask, A. L. Owczarek, and S. G. Whittington, Exact enumeration study of free energies of interacting polygons and walks in two dimensions, J. Phys. A: Math. Gen. 31 (1998), 4725-4741. [See Table B1 (pp. 4738-4739), where the numbers must be multiplied by 4. - _Petros Hadjicostas_, Jan 05 2019]
- M. E. Fisher and B. J. Hiley, Configuration and free energy of a polymer molecule with solvent interaction, J. Chem. Phys., 34 (1961), 1253-1267.
- A. M. Nemirovsky, K. F. Freed, T. Ishinabe, and J. F. Douglas, Marriage of exact enumeration and 1/d expansion methods: lattice model of dilute polymers, J. Statist. Phys., 67 (1992), 1083-1108.
- Sequence Fans Mailing list, discussion of this sequence, November 2010
A329520
a(n) is the number of completed steps before being trapped for a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest spiral number and with n or fewer visited neighbors. It only moves to squares with n+1 or more visited neighbors when no other squares are available, and if two or more such squares are present it chooses the square with the fewest visited neighbors, then the square with the lowest spiral number if still tied.
Original entry on oeis.org
1151, 225, 1866, 513316, 11171, 3935788, 23014, 2015
Offset: 1
a(6) = 3935788. See A329519.
a(7) = 23014. See A329518.
a(8) = 2015. See A316667.
See A316667 for the spiral board numbering.
- Scott R. Shannon, The knight's path for n = 1. The knight is trapped after 1151 steps. In this and other images the first square is marked in green, the final square in red, and the eight blocking squares in blue.
- Scott R. Shannon, The knight's path for n = 2. The knight is trapped after only 225 steps. The start square acts as one of the blocking squares.
- Scott R. Shannon, The knight's path for n = 4. The knight is trapped after 513316 steps. In this image the cyan points indicate where the knight would have gone to a square with eight neighbors, and thus been trapped, if these were not rejected by the n = 4 cutoff. The yellow colored points indicate similar but for combined neighbor counts of five, six and seven neighbors. The final square is in the cusp of the outer edge near the 7:30 clock position.
- N. J. A. Sloane and Brady Haran, The Trapped Knight, Numberphile video (2019).
Comments