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.

Showing 1-5 of 5 results.

A094061 Number of n-moves paths of a king starting and ending at the origin of an infinite chessboard.

Original entry on oeis.org

1, 0, 8, 24, 216, 1200, 8840, 58800, 423640, 3000480, 21824208, 158964960, 1171230984, 8668531872, 64574844048, 483114856224, 3630440899800, 27379154692032, 207172490054816, 1572194644061184, 11962847247681616, 91242602561647680, 697438669619791008
Offset: 0

Views

Author

Matthijs Coster, Apr 29 2004

Keywords

Comments

The chessboard here is the full four-quadrant board Z X Z.
This is an analog of A054474 for walks on a square grid where the steps can be made diagonally as well.
a(n) is the constant term in the expansion of ((x + 1/x) * (y + 1/y) + x^2 + 1/x^2 + y^2 + 1/y^2)^n. - Seiichi Manyama, Nov 03 2019

References

  • D. Joyner, "Adventures in Group Theory: Rubik's Cube, Merlin's Machine and Other Mathematical Toys", Johns Hopkins University Press, 2002, pp. 79

Crossrefs

Programs

  • Maple
    a:=array(0..30):a[0]:=1:a[1]:=0:a[2]:=8:a[3]:=24:for n from 3 to 29 do a[n+1]:= (n*(5*n+1)*a[n]+2*(15*n^2+6*n-5)*a[n-1]-8*(5*n^2-23*n+21)*a[n-2]-64*(n-2)^2*a[n-3])/(n+1)^2: print(n+1,a[n+1]) od:
    # second Maple program
    a:= proc(n) option remember; `if`(n<3, (n-1)*(9*n-2)/2,
          ((n-1)*(3*n-1)*(3*n-4) *a(n-1)
          +(108*n^3-396*n^2+452*n-152) *a(n-2)
          +32*(3*n-2)*(n-2)^2 *a(n-3))/ (n^2*(3*n-5)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 02 2012
  • Mathematica
    a[n_]:=Module[{f=(x+x^-1+y+y^-1+x y+x^-1y+x^-1y^-1+x y^-1)^n,s}, s=Series[f,{x,0,0},{y,0,0}]; SeriesCoefficient[s,{0,0}]]; Table[a[n], {n,1,22}] (* Armin Vollmer (Armin.Vollmer(AT)kabelleipzig.de), May 01 2006 *)
    CoefficientList[Series[1/(1+4*x)*LegendreP[-1/2,1-32*x*(1+x)/(1+4*x)^2], {x, 0, 20}], x] (* Vaclav Kotesovec, Aug 16 2013 *)
  • Maxima
    a[0]:1$
    a[1]:0$
    a[2]:8$
    a[3]:24$
    a[n]:=((n-1)*(3*n-1)*(3*n-4) *a[n-1]
          +(108*n^3-396*n^2+452*n-152) *a[n-2]
          +32*(3*n-2)*(n-2)^2 *a[n-3])/ (n^2*(3*n-5))$
    A094061(n):=a[n]$
    makelist(A094061(n),n,0,30); /* Martin Ettl, Nov 03 2012 */
    
  • PARI
    {a(n) = sum(k=0, n, (-1)^(n-k)*binomial(n, k)*polcoef((1+x+1/x)^k, 0)^2)} \\ Seiichi Manyama, Oct 29 2019
    
  • PARI
    {a(n) = polcoef(polcoef(((x+1/x)*(y+1/y)+x^2+1/x^2+y^2+1/y^2)^n, 0), 0)} \\ Seiichi Manyama, Nov 03 2019

Formula

D-finite with recurrence (n+1)^2*a(n+1) = n*(5*n+1)*a(n) + 2*(15*n^2+6*n-5)*a(n-1) - 8*(5*n^2-23*n+21) *a(n-2) - 64*(n-2)^2*a(n-3).
G.f.: (2/(Pi*(1+4*x))) * EllipticK(4*sqrt(x*(1+x))/(1+4*x)) = 1/(1+4*x) * hypergeom([1/2,1/2], [1], 16*(x*(1+x))/(1+4*x)^2). - Sergey Perepechko, Jan 15 2011
a(n) ~ 2^(3*n+1)/(3*Pi*n). - Vaclav Kotesovec, Aug 16 2013
a(n) = (1/Pi^2) * Integral_{y = 0..Pi} Integral_{x = 0..Pi} (2*cos(x) + 2*cos(y) + 4*cos(x)*cos(y))^n dx dy. - Peter Bala, Feb 14 2017
a(n) = Sum_{k=0..n} (-1)^(n-k) * binomial(n,k) * A002426(k)^2. - Seiichi Manyama, Oct 29 2019
From Peter Bala, Feb 08 2022: (Start)
The Gauss congruences a(n*p^k) == a(n*p^(k-1)) (mod p^k) hold for all primes p and positive integers n and k.
Conjecture: the stronger congruences a(n*p^k) == a(n*p^(k-1)) (mod p^(2*k)) hold for all primes p >= 5 and positive integers n and k. (End)
a(n) = Sum_{j = 0..n} Sum_{k = 0..j} binomial(2*j,j)^2*binomial(j,k)* binomial(n+j-k,2*j)*(-4)^(n-j-k). - Peter Bala, Mar 19 2022

Extensions

More terms from and entry improved by Sergey Perepechko, Sep 06 2004

A254129 Number of 2n-move closed knight paths on an unbounded chessboard from a given square to the same square.

Original entry on oeis.org

1, 8, 168, 5840, 261800, 13180608, 702273264, 38641656768, 2171652448680, 123938999632448, 7158206751686848, 417418594698260064, 24535017440445455216, 1451786144317963971200, 86396682439552099487040, 5166936574734171792925440, 310340697572034456203934120
Offset: 0

Views

Author

David A. Corneth, Jan 25 2015

Keywords

Comments

Every move changes the color of the square the knight is on, so there is no returning path of odd length.

Examples

			a(1) = 8. For illustration, let's assume we're on a usual 8 X 8 chessboard, with the knight initially at D4. Then there are 8 paths bringing it back to D4 in 2 moves:
D4-E6-D4; D4-F5-D4; D4-F3-D4; D4-E2-D4; D4-C2-D4; D4-B3-D4; D4-B5-D4; D4-C6-D4.
		

Crossrefs

Programs

  • Maple
    G:= cos(x+2*y)+cos(x-2*y)+cos(2*x+y)+cos(2*x-y):
    F:= 1: a[0]:= 1:
    for n from 1 to 20 do
      F:= combine(F*G^2,trig);
      a[n]:= 4^n*remove(has,F,cos);
    od:
    seq(a[n],n=0..20);  # Robert Israel, Jan 26 2015
    # second Maple program:
    b:= proc(n, x, y) option remember; `if`(max(x, y)>2*n or x+y>3*n, 0,
          `if`(n=0, 1, add(b(n-1, abs(x+l[1]), abs(y+l[2])), l=[[1, 2],
          [2, 1], [-1, 2], [-2, 1], [1, -2], [2, -1], [-1, -2], [-2, -1]])))
        end:
    a:= n-> b(2*n, 0$2):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 29 2015
  • Mathematica
    b[n_, x_, y_] := b[n, x, y] = If[Max[x, y] > 2n || x+y > 3n, 0, If[n == 0, 1, Sum[b[n-1, Abs[x+l[[1]]], Abs[y+l[[2]]]], {l, {{1, 2}, {2, 1}, {-1, 2}, {-2, 1}, {1, -2}, {2, -1}, {-1, -2}, {-2, -1}}}]]];
    a[n_] :=  b[2n, 0, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Apr 30 2019, after Alois P. Heinz *)
  • PARI
    a(n)={my(l=listcreate(),v=vector(2*n+1));m=matrix(1,1);m[1,1]=1;listput(l,m);v[1]=1;for(i=2,2*n+1, m=matrix(4*i-3,4*i-3);for(j=1,#l[i-1],for(k=1,#l[i-1],m[j+2-2,k+2-1]+=l[i-1][j,k];m[j+2-2,k+2+1]+=l[i-1][j,k];m[j+2-1,k+2-2]+=l[i-1][j,k];m[j+2-1,k+2+2]+=l[i-1][j,k];m[j+2+1,k+2-2]+=l[i-1][j,k];m[j+2+1,k+2+2]+=l[i-1][j,k];m[j+2+2,k+2-1]+=l[i-1][j,k];m[j+2+2,k+2+1]+=l[i-1][j,k]));v[i]=m[2*i-1,2*i-1];listput(l,m););listput(l,v);v[#v]} \\ David A. Corneth, Jan 26 2015
    
  • PARI
    {a(n) = polcoef(polcoef((x^2*y+x*y^2+y^2/x+y/x^2+1/(x^2*y)+1/(x*y^2)+x/y^2+x^2/y)^(2*n), 0), 0)} \\ Seiichi Manyama, Nov 02 2019

Formula

From Robert Israel, Jan 26 2015: (Start)
a(n) = 4^n * (2*Pi)^(-2) * int_0^(2*Pi) int_0^(2*Pi) ds dt (cos(s+2*t)+cos(s-2*t)+cos(2*s+t)+cos(2*s-t))^(2*n).
G.f.: (2*Pi)^(-2) * int_0^(2*Pi) int_0^(2*Pi) ds dt 1/(1 - 4*x*(cos(s+2*t)+cos(s-2*t)+cos(2*s+t)+cos(2*s-t))^2).
(End)
a(n) ~ 64^n / (5*Pi*n). - Vaclav Kotesovec, Jan 28 2015
Recurrence (conjectured): 3*n^2*(3*n-2)*(3*n-1)*(4*n-3)*(4*n-1)*(58625*n^6 - 574525*n^5 + 2317575*n^4 - 4929815*n^3 + 5836090*n^2 - 3647730*n + 940788)*a(n) = 4*(563444875*n^12 - 7212094400*n^11 + 40894216825*n^10 - 135653664390*n^9 + 292742658975*n^8 - 432166599360*n^7 + 446527351283*n^6 - 324481592710*n^5 + 164046706898*n^4 - 56035458036*n^3 + 12203976528*n^2 - 1507156200*n + 78246000)*a(n-1) - 64*(n-1)*(2*n-3)^2*(167726125*n^9 - 1643716025*n^8 + 6735239425*n^7 - 15048594215*n^6 + 20072439970*n^5 - 16473493280*n^4 + 8273936628*n^3 - 2437948332*n^2 + 377982648*n - 22556880)*a(n-2) + 165888*(n-2)*(n-1)*(2*n - 5)^2*(2*n - 3)^2*(58625*n^6 - 222775*n^5 + 324325*n^4 - 232265*n^3 + 86220*n^2 - 15570*n + 1008)*a(n-3). - Vaclav Kotesovec, Jan 30 2015
a(n) = the constant term in the expansion of (x^2*y + x*y^2 + y^2/x + y/x^2 + 1/(x^2*y) + 1/(y^2*x) + x/y^2 + x^2/y)^(2*n). - Peter Bala, Feb 14 2017
The conjectured recurrence of Vaclav Kotesovec is true. Running the input file inSMAZ6 (see Links) on the Maple program SMAZ gives the recurrence followed by the certificate shown in the output file oSMAZ6. - Doron Zeilberger, Mar 29 2019

A253974 Number of 2n-move closed giraffe paths on an unbounded chessboard from a given square to the same square.

Original entry on oeis.org

1, 8, 168, 5120, 190120, 7964208, 362370624, 17532536736, 889716433320, 46887220540160, 2546408317827088, 141659449976239104, 8033749056463329472, 462687411167492828000, 26980019699392099317600, 1589091557661690119997120, 94361786346423775855372200
Offset: 0

Views

Author

Vaclav Kotesovec, Jan 31 2015

Keywords

Comments

Giraffe is a (fairy chess) leaper [1,4].
Conjecture: Number of 2n-move closed paths of leaper [r,s] on an unbounded chessboard, where 0 < r < s and gcd(r,s)=1, is asymptotic to 2^(6*n+1) / ((r^2+s^2)*Pi*n) if r+s is even, and 2^(6*n) / ((r^2+s^2)*Pi*n) if r+s is odd.

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(max(x, y)>4*n or x+y>5*n, 0,
          `if`(n=0, 1, add(b(n-1, abs(x+l[1]), abs(y+l[2])), l=[[4, 1],
          [1, 4], [-4, 1], [-1, 4], [4, -1], [1, -4], [-4, -1], [-1, -4]])))
        end:
    a:= n-> b(2*n, 0$2):
    seq(a(n), n=0..25); # after Alois P. Heinz
    # second Maple program:
    poly:=expand((x*y^4+x^4*y+y^4/x+y/x^4+x/y^4+x^4/y+1/(x*y^4)+1/(x^4*y))^2): z:=1: for n to 100 do z:=expand(z*poly): print(n, coeff(coeff(z, x, 0), y, 0)); end do: # Vaclav Kotesovec, Apr 03 2019
  • Mathematica
    b[n_, x_, y_] := b[n, x, y] = If[Max[x, y] > 4n || x + y > 5n, 0, If[n == 0, 1, Sum[b[n - 1, Abs[x + l[[1]]], Abs[y + l[[2]]]], {l, {{4, 1}, {1, 4}, {-4, 1}, {-1, 4}, {4, -1}, {1, -4}, {-4, -1}, {-1, -4}}}]]];
    a[n_] := b[2n, 0, 0];
    a /@ Range[0, 25] (* Jean-François Alcover, Nov 01 2020, after Maple *)

Formula

a(n) ~ 64^n / (17*Pi*n).
a(n) = the constant term in the expansion of (x*y^4 + x^4*y + 1/x*y^4 + 1/x^4*y + x/y^4 + x^4/y + 1/x/y^4 + 1/x^4/y)^(2*n). - Vaclav Kotesovec, Apr 01 2019

A297740 The number of distinct positions on an infinite chessboard reachable by the (2,3)-leaper in <= n moves.

Original entry on oeis.org

1, 9, 41, 129, 321, 625, 997, 1413, 1885, 2425, 3033, 3709, 4453, 5265, 6145, 7093, 8109, 9193, 10345, 11565, 12853, 14209, 15633, 17125, 18685, 20313, 22009, 23773, 25605, 27505, 29473, 31509, 33613, 35785, 38025, 40333, 42709, 45153, 47665, 50245, 52893
Offset: 0

Views

Author

R. J. Mathar, Jan 05 2018

Keywords

Crossrefs

Cf. A018836 (1,2)-leaper or (1,3)-leaper, A297741 (3,4)-leaper.
Partial sums of A018839.

Programs

  • Mathematica
    LinearRecurrence[{3, -3, 1}, {1, 9, 41, 129, 321, 625, 997, 1413, 1885, 2425}, 50] (* Paolo Xausa, Mar 17 2024 *)
  • PARI
    Vec((1 + x)*(1 + 5*x + 12*x^2 + 20*x^3 + 28*x^4 - 20*x^5 - 24*x^6 + 12*x^8) / (1 - x)^3 + O(x^40)) \\ Colin Barker, Jan 07 2018

Formula

a(n) = 34*n^2 + 30*n + 9 for n >= 6.
From Colin Barker, Jan 05 2018: (Start)
G.f.: (1 + x)*(1 + 5*x + 12*x^2 + 20*x^3 + 28*x^4 - 20*x^5 - 24*x^6 + 12*x^8) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>9. (End)

A307347 Number of 2n-move closed antelope paths on an unbounded chessboard from a given square to the same square.

Original entry on oeis.org

1, 8, 168, 5120, 190120, 7939008, 357713664, 17010543264, 842994009000, 43192225007360, 2275378947981568, 122724475613935104, 6753785574641857024, 378138077830110886400, 21486835143540141873120, 1236506847203439155401920, 71934214120446285067176360
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 03 2019

Keywords

Comments

Antelope is a leaper [3,4].

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(max(x, y)>4*n or x+y>7*n, 0,
          `if`(n=0, 1, add(b(n-1, abs(x+l[1]), abs(y+l[2])), l=[[4, 3],
          [3, 4], [-4, 3], [-3, 4], [4, -3], [3, -4], [-4, -3], [-3, -4]])))
        end:
    a:= n-> b(2*n, 0$2):
    seq(a(n), n=0..25);
    # second Maple program:
    poly := expand((x^4*y^3 + x^3*y^4 + 1/x^4*y^3 + 1/x^3*y^4 + x^4/y^3 + x^3/y^4 + 1/x^4/y^3 + 1/x^3/y^4)^2): z:=1: for n to 100 do z:=expand(z*poly): print(n, coeff(coeff(z, x, 0), y, 0)); end do:
  • Mathematica
    poly = Expand[(x^4*y^3 + x^3*y^4 + 1/x^4*y^3 + 1/x^3*y^4 + x^4/y^3 + x^3/y^4 + 1/x^4/y^3 + 1/x^3/y^4)^2]; z = 1; Flatten[{1, Table[z = Expand[z*poly]; z[[1]], {n, 1, 15}]}]

Formula

a(n) = the constant term in the expansion of (x^4*y^3 + x^3*y^4 + 1/x^4*y^3 + 1/x^3*y^4 + x^4/y^3 + x^3/y^4 + 1/x^4/y^3 + 1/x^3/y^4)^(2*n).
Conjecture: a(n) ~ 64^n / (25*Pi*n).
Showing 1-5 of 5 results.