cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 31-40 of 4476 results. Next

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

Views

Author

Manuel Kauers, Nov 18 2008

Keywords

Comments

Essentially the same as A052704. - R. J. Mathar, Nov 27 2008
From Joerg Arndt, Oct 22 2012: (Start)
Number of strings of length 2*n of four different types of balanced parentheses.
The number of strings of length 2*n of t different types of balanced parentheses is given by t^n * A000108(n): there are n opening parentheses in the strings, giving t^n choices for the type (the closing parentheses are chosen to match). (End)
Number of Dyck paths of length 2n in which the step U=(1,1) comes in 4 colors. - José Luis Ramírez Ramírez, Jan 31 2013

References

  • Richard P. Stanley, Catalan Numbers, Cambridge, 2015, p. 106.

Crossrefs

Programs

  • Magma
    [4^n * Catalan(n): n in [0..20]]; // Vincenzo Librandi, Oct 24 2012
    
  • Maple
    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
  • Mathematica
    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}]
  • Sage
    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

Formula

a(n) = 4^n*A000108(n). - Philippe Deléham, Feb 01 2009
a(n) = Integral_{x=-2..2} (2*x)^(2*n)*sqrt((2-x)*(2+x))/(2*Pi) dx. - Peter Luschny, Sep 11 2011
E.g.f.: KummerM(1/2, 2, 16*x). - Peter Luschny, Aug 26 2012
G.f.: 2/(1 + sqrt(1-16*x)) = 1/U(0) where U(k) = 1 - 4*x/U(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 30 2012
G.f.: c(4*x) with c(x) the o.g.f. of A000108 (Catalan). - Philippe Deléham, Nov 15 2013
a(n) = sum{k=0..n} A085880(n,k)*3^k. - Philippe Deléham, Nov 15 2013
a(n) = 4^n*hypergeom([1-n,-n],[2],1). - Peter Luschny, Sep 22 2014
a(n) = 4^n*(2*n)!*[x^(2*n)]hypergeom([],[2],x^2). - Peter Luschny, Jan 31 2015
a(n) ~ 2^(4*n+2)/((2*n+1)*sqrt(Pi*(4*n+5))). - Peter Luschny, Jan 31 2015
D-finite with recurrence: (n+1)*a(n) +8*(-2*n+1)*a(n-1)=0. - R. J. Mathar, Feb 21 2020
Sum_{n>=0} 1/a(n) = 88/75 + 128*arctan(1/sqrt(15)) / (75*sqrt(15)). - Vaclav Kotesovec, Nov 23 2021
Sum_{n>=0} (-1)^n/a(n) = 248/289 - 384*arctanh(1/sqrt(17)) / (289*sqrt(17)). - Amiram Eldar, Jan 25 2022
G.f.: 1/(1-4*x/(1-4*x/(1-4*x/(1-4*x/(1-4*x/(1-4*x/(1-4*x/(1-4*x/(1-...)))))))))(continued fraction), cf. g.f. by Sergei N. Gladkovskii. - Nikolaos Pantelidis, Nov 21 2022
a(n) = 4*A269796(n-1) for n>0. - Hugo Pfoertner, Oct 04 2024

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

Views

Author

Keywords

Comments

Number of walks of length 2n+5 in the path graph P_6 from one end to the other one. Example: a(1)=5 because in the path ABCDEF we have ABABCDEF, ABCBCDEF, ABCDCDEF, ABCDEDEF and ABCDEFEF. - Emeric Deutsch, Apr 02 2004
Since a(n) is the binomial transform of A006054 from formula (3.63) in the Witula-Slota-Warzynski paper, it follows that a(n)=A(n;1)*(B(n;-1)-C(n;-1))-B(n;1)*B(n;-1)+C(n;1)*(A(n;-1)-B(n;-1)+C(n;-1)), where A(n;1)=A077998(n), B(n;1)=A006054(n+1), C(n;1)=A006054(n), A(n;-1)=A121449(n), B(n+1;-1)=-A085810(n+1), C(n;-1)=A215404(n) and A(n;d), B(n;d), C(n;d), n in N, d in C, denote the quasi-Fibonacci numbers defined and discussed in comments in A121449 and in the cited paper. - Roman Witula, Aug 09 2012
From Wolfdieter Lang, Mar 30 2020: (Start)
With offset -4 this sequence 6, 1, 0, 0, 1, 5, ... appears in the formula for the n-th power of the 3 X 3 tridiagonal Matrix M_3 = Matrix([1,1,0], [1,2,1], [0,1,2]) from A332602: (M_3)^n = a(n-2)*(M_3)^2 - (6*a(n-3) - a(n-4))*M_3 + a(n-3)*1_3, with the 3 X 3 unit matrix 1_3, for n >= 0. Proof from Cayley-Hamilton: (M_3)^n = 5*(M_3)^3 - 6*M_3 + 1_3 (see A332602 for the characteristic polynomial Phi(3, x)), and the recurrence (M_3)^n = M_3*(M_3)^(n-1). For (M_3)^n[1,1] = 2*a(n-2) - 5*a(n-3) + a(n-4), for n >= 0, see A080937(n).
The formula for a(n) in terms of r = rho(7) = A160389 given below shows that a(n)/a(n-1) converges to rho(7)^2 = A116425 = 3.2469796... for n -> infinity. This is because r - 2/r = 0.692..., and r - 1 - 1/r = 0.137... .
(End)

References

  • 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).

Crossrefs

Double partial sums of A060557. Bisection of A052547.

Programs

  • Magma
    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
    
  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    x='x+O('x^30); Vec(1/(1-5*x+6*x^2-x^3)) \\ G. C. Greubel, Apr 19 2018

Formula

G.f.: 1/(1-5x+6x^2-x^3). - Emeric Deutsch, Apr 02 2004
a(n) = 5*a(n-1) -6*a(n-2) +a(n-3). - Emeric Deutsch, Apr 02 2004
a(n) = Sum_{j=-infinity..infinity} (binomial(5+2*k, 7*j+k-2) - binomial(5+2*k, 7*j+k-1)) (a finite sum).
a(n-2) = 2^n*C(n;1/2)=(1/7)*((c(2)-c(4))*(c(4))^(2n) + (c(4)-c(1))*(c(1))^(2n) + (c(1)-c(2))*(c(2))^(2n)), where a(-2)=a(-1):=0, c(j):=2*cos(2Pi*j/7). This formula follows from the Binet formula for C(n;d)--one of the quasi-Fibonacci numbers (see comments in A121449 and the formula (3.17) in the Witula-Slota-Warzynski paper). - Roman Witula, Aug 09 2012
In terms of the algebraic number r = rho(7) = 2*cos(Pi/7) = A160389 of degree 3 the preceding formula gives a(n) = r^(2*(n+2))*(A1(r) + A2(r)*(r - 2/r)^(2*(n+1)) = A3(r)*(r - 1 - 1/r)^(2*(n+1)))/7, for n >= -4 (see a comment above for this offset), with A1(r) = -r^2 + 2*r + 1, A2(r) = -r^2 - r + 2, and A3(r) = 2*r^2 - r - 3. - Wolfdieter Lang, Mar 30 2020

Extensions

a(25)-a(26) from Vincenzo Librandi, Sep 18 2015

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

Views

Author

David Bevan, Jul 19 2006

Keywords

Examples

			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)
		

Crossrefs

Formula

a(n) = A096969(n) / 2 for n > 1.

Extensions

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

Views

Author

Alois P. Heinz, Feb 29 2012

Keywords

Comments

A(n,k) is also the number of (n*k-1)-step walks on k-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that for each point (p_1,p_2,...,p_k) we have p_1<=p_2<=...<=p_k or p_1>=p_2>=...>=p_k.

Examples

			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, ...
		

Crossrefs

Rows 0+1, 2-10 give: A000012, A141351 (for n>1), A208616, A208617, A208618, A208619, A208620, A208621, A208622, A208623.
Main diagonal gives: A208631.
Antidiagonal sums give: A208729.

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Scott R. Shannon, Feb 23 2020

Keywords

Comments

This sequence is the complement to A330979; here only composite numbers can be stepped to, while in A330979 only prime numbers can be stepped to. Due to the existence of many more composite numbers than primes the walk here forms a much tigher spiral and generally stays as close as possible to the origin. However the primes occasionally block this preferred path and causes the walk to detour away from the origin, which leaves gaps in the visited squares with composite numbers. Some of these gaps are eventually visited by later steps in the walk.
The first term at which a step to a non-adjacent square is required is a(154) = 74, which steps to a(155) = 158, a distance of sqrt(8) units away. The square with number 74 is surrounded by three primes 43,73,113 and five composites 44,72,75,112,114, all of which have been previously visited.
In the first 1 million terms the longest required step is from a(149464) = 64666, which has coordinates (-127,-22) relative to the starting 1-square, to a(149465) = 67774 with coordinates (-130,-43), a step of length sqrt(450), approximately 21.2 units. See A330782 for the progression of step length records. If the maximum step distance between adjacent composite terms has a finite value or is unbounded as n increases is unknown. The largest difference between adjacent composite terms is for a(650382) = 863400 to a(650383) = 939342, a difference of 75942.
In the first 1 million terms the smallest unvisited composite is 12, which is at coordinates (2,1) relative to the starting square. This square is surrounded by four primes so the walk is never required to step to it during the initial walk steps. See the image in the links. Given the composites become more frequent relative to the primes as n increases it would require a very large detour from the spiral pattern for this square to be visited, so it is likely, although unknown, this square will never be visited. However the link image for 1 million steps shows the path can make detours toward the central square when it is trapped by surrounding paths, so the possibility remains the inner unvisited squares could eventually be visited, although the number of walk steps required before such a detour occurs could be extremely large.

Examples

			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.
		

Crossrefs

Cf. A330782, A000040, A063826, A136626, A331027, A330979 (same rules but stepping to prime numbers).

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

Views

Author

Keywords

Comments

a(n) is the number of involutions of length 2n which are invariant under the reverse-complement map and have no decreasing subsequences of length 5. - Eric S. Egge, Oct 21 2008

Examples

			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
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(2*n) = A000894(n), a(2*n+1) = 2*A060150(n+1).

Programs

  • Magma
    [Binomial(n, Floor(n/2))*Binomial(n+1, Floor((n+1)/2)): n in [0..30]]; // Vincenzo Librandi, Feb 18 2015
  • Mathematica
    f[n_] := Binomial[n, Floor[n/2]] Binomial[n + 1, Floor[(n + 1)/2]]; Array[f, 25, 0] (* Robert G. Wilson v *)

Formula

a(n) = binomial(n, floor(n/2))*binomial(n+1, floor((n+1)/2)).
E.g.f.: (BesselI(0, 2*x)+BesselI(1, 2*x))^2. - Vladeta Jovovic, Apr 28 2003
EXPCONV of A001405 with itself, i.e., a(n) = sum_{k=0}^n binomial(n,k)*A001405(k)*A001405(n-k). - Max Alekseyev, May 18 2006
G.f.: (16*x^2-1)*hypergeom([3/2, 3/2],[2],16*x^2) + (1/(2x)+2)*hypergeom([1/2, 1/2],[1],16*x^2) - 1/(2x). - Mark van Hoeij, Oct 13 2009
G.f.: (hypergeom([1/2,1/2],[1],16*x^2) - 1)/(2*x) + hypergeom([1/2,3/2],[2],16*x^2). - Mark van Hoeij, Aug 14 2014
a(n) = A241530(n)*2*floor(n/2)/(floor(n/2)+1). - Peter Luschny, Apr 25 2014
D-finite with recurrence (n+2)*(n+1)*a(n) +4*(-2*n-1)*a(n-1) -16*n*(n-1)*a(n-2)=0. - R. J. Mathar, Mar 07 2015
0 = a(n)*(+16*a(n+2) -6*a(n+3)) +a(n+1)*(-2*a(n+2) +a(n+3)) if n >= 0. - Michael Somos, Oct 17 2019
a(n) = binomial(floor(n + 1/2), floor(n/2)) * binomial(ceiling(n + 1/2), ceiling(n/2)). - Peter Luschny, Dec 14 2024

Extensions

Additional comments from David W. Wilson, May 05 2001
a(25)-a(26) from Vincenzo Librandi, Feb 18 2015

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

Views

Author

Keywords

Comments

a(n) = 4n*A002931(n). There are (2n) choices for the starting point and 2 choices for the orientation, in order to produce self-avoiding closed paths from a polygon of perimeter 2n. - Philippe Flajolet, Nov 22 2003

References

  • 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).

Crossrefs

Cf. A002931.

Programs

  • Mathematica
    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 *)
  • Python
    # 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

Views

Author

Alessandro Zinani (alzinani(AT)tin.it), May 19 2000

Keywords

Comments

1-dimensional and 3-dimensional analogs are A002420 and A049037.
Trajectories returning to the origin are prohibited, contrary to the situation in A094061.
The probability of returning to the origin for the first time after 2n steps is given by a(n)/4^(2*n). If A(x) is a generating function for this sequence, A(x/16) is a generating function for the sequence of probabilities. The sum of these probabilities for n > 0 is 1 unlike in dimensions > 2. - Shel Kaphan, Feb 13 2023

Examples

			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.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 322-331.

Crossrefs

Column k=2 of A361397.

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    a(n)=if(n<0,0,polcoeff(2-agm(1,sqrt(1-16*x+x*O(x^n))),n))

Formula

G.f.: 2 - AGM(1, (1-16*x)^(1/2)).
G.f.: 2 - 1/hypergeom([1/2,1/2],[1],16*x). - Joerg Arndt, Jun 16 2011
Let (in Maple notation) G(x):=4/Pi*EllipticK(4*t)-2/Pi*EllipticF(1/sqrt(2+4*t), 4*t)-2/Pi*EllipticF(1/sqrt(2-4*t), 4*t), then GenFunc(x):=2-1/G(x). - Sergey Perepechko, Sep 11 2004
G.f.: 2 - Pi/(2*EllipticK(4*sqrt(x))). - Vladeta Jovovic, Jun 23 2005
a(n) ~ Pi * 16^n / (n * log(n)^2) * (1 - (2*gamma + 8*log(2)) / log(n) + (3*gamma^2 + 24*log(2)*gamma + 48*log(2)^2 - Pi^2/2) / log(n)^2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Sep 29 2019
INVERTi transform of A002894. - R. J. Mathar, Sep 24 2020

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

Views

Author

Joseph Myers, Nov 22 2010

Keywords

Comments

Fisher and Hiley give 396204 as their last term instead of 396172 (see A002932). Douglas McNeil confirms 396172 (see seqfan discussion).
Comment from N. J. A. Sloane, Nov 27 2010: Joseph Myers has discovered that several of the sequences listed by Fisher and Riley (1961) contained errors. R. J. Mathar comments that this article has 62 citations in http://adsabs.harvard.edu/abs/1961JChPh..34.1253F and that clicking through these with the "Citations to the Article (62)" button is one way to check the numbers by searching for corrections.
From Petros Hadjicostas, Jan 01 2019: (Start)
Nemirovsky et al. (1992), for a d-dimensional hypercubic lattice, define C_{n,m} to be "the number of configurations of an n-bond self-avoiding chain with m neighbor contacts." For d=2 (square lattice) and m=0 (no neighbor contacts), we have (for the current sequence) a(n) = C(n, m=0). These values (from n=1 to n=11) are listed in Table I (p. 1088) in the paper.
According to Eq. (5), p. 1090, in the above paper, for a general d, the partition number C_{n,m} satisfies C_{n,m} = Sum_{l=1..n} 2^l*l!*Bin(d,l)*p_{n,m}^{(l)}, where the coefficients p_{n,m}^{(l)} (l=1,2,...) are independent of d. For d=2 (square lattice), this becomes C_{n,m} = Sum_{l=1..n} 2^l*l!*Bin(2,l)*p_{n,m}^{(l)}.
According to Eq. (7a) and (7b), p. 1093, in the paper, p_{n,0}^{(1)} = 1 = p_{n,0}^{(n)}, p_{n,m}^{(1)} = 0 for m >= 1, and p_{n,m}^{(l)} = 0 for m >= 1 and n-m+1 <= l <= n.
Now, assume d=2. Since p_{n,0}^{(1)} = 1 for n >= 1, we have C_{1,0} = 2^1*1!*Bin(2,1)*1 = 4, while C_{n,0} = 4 + 2^2*2!*Bin(2,2)*p_{n,0}^{(2)} = 4 + 8*p_{n,0}^{(2)} for n >= 2. The partition numbers p_{n,0}^{(2)} appear in Table II, p. 1093, in the paper. We have p_{n,0}^{(2)} = A038746(n) (with p_{1,0}^{(2)} = 0 to make the formula C_{n,0} = 4 + 8*p_{n,0}^{(2)} valid even for n=1).
(End)

References

  • 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).

Crossrefs

Programs

Formula

a(n) = 4 + 8*A038746(n) for n>=1.

Extensions

a(23)-a(32) from Bert Dobbelaere, Jan 02 2019
a(33)-a(35) from Scott R. Shannon, Aug 25 2020

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

Views

Author

Scott R. Shannon, Nov 19 2019

Keywords

Comments

This sequence gives the number of completed steps for a knight before being trapped when moving on a square-spiral numbered board and at each step choosing an unvisited square one knight-leap away which has the lowest spiral number and has n or fewer visited neighboring squares. It will only move to a square with n+1 or more neighbors when no square with n or fewer neighbors is available. If it is forced to move to such squares and two or more are available, it will choose the square with the fewest neighbors. If two or more squares with the same number of neighbors exist then it will choose the square with the smallest spiral number.
For n = 8 the path is equivalent to that given in A316667. Every square will always have eight or fewer visited neighbors, thus all unvisited squares are available to move to and the one with the smallest spiral number will always be chosen. This is A316667.
The values are surprisingly diverse, and it is not immediately obvious that the smaller values of n will even have a finite path length. It seems reasonable to assume that with the knight always choosing squares with very few visited neighbors it would be constantly moving away from the origin and thus never be trapped. But the path taken shows that, with such a restrictive choice of neighboring squares, the path leaves large areas of unvisited squares as the knight moves around the board, some of these being relatively close to the origin. At some point the knight will have an open path and move to these squares, thus move toward the origin, due to its preference to choose the squares with the smallest spiral number. It is thus drawn inward where it will then be surrounded by previous visited squares and eventually trapped. This tendency to leave large areas of unvisited squares is most easily seen in the path for n = 2, see link below, which is trapped after only 225 steps.
On the other extreme the path for n = 6, see A329519, is such that very few open areas remain near the origin, but the knight is still cautious in its choice and will not move to a square where it will likely be trapped, unless no other choices exist. This leads to the knight performing an extremely long walk before eventually finding a gap in its previous paths, moving toward the origin and finally being trapped after 3935788 steps.

Examples

			a(6) = 3935788. See A329519.
a(7) = 23014. See A329518.
a(8) = 2015. See A316667.
See A316667 for the spiral board numbering.
		

Crossrefs

Previous Showing 31-40 of 4476 results. Next