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 11-20 of 26 results. Next

A189281 Number of permutations p of 1,2,...,n satisfying p(i+2) - p(i) <> 2 for all 1 <= i <= n-2.

Original entry on oeis.org

1, 1, 2, 5, 18, 75, 410, 2729, 20906, 181499, 1763490, 18943701, 222822578, 2847624899, 39282739034, 581701775369, 9202313110506, 154873904848803, 2762800622799362, 52071171437696453, 1033855049655584786, 21567640717569135515
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 19 2011

Keywords

Comments

a(n) is also the number of ways to place n nonattacking pieces rook + semi-leaper (2,2) on an n X n chessboard.
Comments from Vaclav Kotesovec, Mar 05 2022: (Start)
The original submission had keyword hard because of the following running times (in 2012):
a(33) 39 hours
a(34) 78 hours
a(35) 147 hours
The conjectured recurrence would imply the asymptotic expansion for a(n)/n! ~
(1 + 3/n + 2/n^2 + 1/n^3 + 0/n^4 + 3/n^5 + 26/n^6 + 101/n^7 + 124/n^8 - 1409/n^9 - 13266/n^10)/e.
This exactly matches the formula from 2011. In addition, all coefficients are integers. It is highly probable that recurrence is correct.
(End)
There are good reasons to believe the conjecture is correct. (It has the expected form.) The problem is one of counting Hamiltonian cycles in the complement of some simple graph. There is a method for counting these efficiently (although I have not implemented in code). Similar to A242522 / A229430. - Andrew Howroyd, Mar 06 2022
See also Manuel Kauers's comments below. Since the four new terms took weeks of computation, the keyword "hard" continues to be justified. - N. J. A. Sloane, Mar 06 2022
a(40)-a(300) were computed using an independent solution (dynamic programming, O(N^4) per term), and the conjectured recurrence was further confirmed to be correct up to n=300. Consequently, the keyword "hard" is removed. - Rintaro Matsuo, Oct 18 2022

Crossrefs

Formula

Asymptotics: a(n)/n! ~ (1 + 3/n + 2/n^2)/e.
Conjectured recurrence of degree 11 and order 8: (262711*n + 1387742*n^2 - 824875*n^3 - 1855253*n^4 - 111530*n^5 + 680983*n^6 + 364242*n^7 + 84992*n^8 + 10332*n^9 + 640*n^10 + 16*n^11)*a(n) + (-1050844*n - 9705192*n^2 - 7414683*n^3 + 3536494*n^4 + 6459004*n^5 + 3326393*n^6 + 903534*n^7 + 144684*n^8 + 13756*n^9 + 720*n^10 + 16*n^11)*a(n+1) + (3492344 - 2212342*n - 8507169*n^2 - 11544227*n^3 - 12034116*n^4 - 8216995*n^5 - 3442049*n^6 - 890050*n^7 - 142300*n^8 - 13660*n^9 - 720*n^10 - 16*n^11)*a(n+2) + (19817984 + 45323852*n + 825228*n^2 - 57004661*n^3 - 57059306*n^4 - 28077270*n^5 - 8398637*n^6 - 1631510*n^7 - 207980*n^8 - 16828*n^9 - 784*n^10 - 16*n^11)*a(n+3) + (9586160 + 6680237*n - 13772613*n^2 - 27689586*n^3 - 22162455*n^4 - 9855085*n^5 - 2629562*n^6 - 427656*n^7 - 41332*n^8 - 2176*n^9 - 48*n^10)*a(n+4) + (22192864 + 44710768*n - 2924668*n^2 - 52385912*n^3 - 45161616*n^4 - 18784740*n^5 - 4549208*n^6 - 674256*n^7 - 60400*n^8 - 3008*n^9 - 64*n^10)*a(n+5) + (557152 - 2032472*n - 2937392*n^2 - 1594200*n^3 - 517688*n^4 - 122032*n^5 - 19856*n^6 - 1792*n^7 - 64*n^8)*a(n+6) + (3786960 + 7105324*n - 1191064*n^2 - 8059160*n^3 - 5938996*n^4 - 2073752*n^5 - 402736*n^6 - 44528*n^7 - 2624*n^8 - 64*n^9)*a(n+7) + (-598208 - 943004*n + 414196*n^2 + 1213772*n^3 + 728648*n^4 + 203584*n^5 + 29616*n^6 + 2176*n^7 + 64*n^8)*a(n+8) = 0. This recurrence correctly predicted the four new terms in the b-file. - Christoph Koutschan, Feb 19 2022
Comment from N. J. A. Sloane, Mar 12 2022: (Start)
The preceding conjectured recurrence is equivalent to the following, which has degree 3 and order 13, and was obtained by Doron Zeilberger and then reformatted by Manuel Kauers (it uses Mathematica syntax):
Conjecture: ((-1 + n)^2*n*a[n])/4 + (n*(-16 + 38*n + 11*n^2)*a[1 + n])/16 +
(3/2 + (139*n)/16 + (29*n^2)/8 + (3*n^3)/16)*a[2 + n] +
(-21/4 - (51*n)/4 - (79*n^2)/16 - (5*n^3)/8)*a[3 + n] +
(-15/2 - n/8 + (5*n^2)/4 + n^3/8)*a[4 + n] +
(603/4 + (307*n)/4 + (49*n^2)/4 + (11*n^3)/16)*a[5 + n] +
(-41 - (533*n)/16 - (49*n^2)/8 - (5*n^3)/16)*a[6 + n] +
(-911/2 - 161*n - (303*n^2)/16 - (3*n^3)/4)*a[7 + n] +
(-363 - (417*n)/4 - (37*n^2)/4 - n^3/4)*a[8 + n] +
(-993/4 - 53*n - (11*n^2)/4)*a[9 + n] + (-130 - (93*n)/4 - n^2)*a[10 + n] +
(-71/4 - 2*n)*a[11 + n] + (-10 - n)*a[12 + n] + a[13 + n] == 0.
(End)
From Mark van Hoeij, Jul 25 2012: (Start)
A compact way to write the order 13 recurrence is as follows:
Let b(n) = a(n+3) + a(n+2) + (n/2+2)*a(n+1) + (n-1)*a(n)/2
and c(n) = b(n+4) + (n/2+2)*b(n+2) - b(n+1)/2 + (1-n)*b(n)/2;
then c(n+6) - (n+11)*c(n+5) - (2*n+75/4)*c(n+4) + (3-n)*c(n+3)/4 - c(n+2)/2 - (7*n+22)*c(n+1)/4-n*c(n) = 0. (End)

A018934 From the game of Mousetrap.

Original entry on oeis.org

0, 0, 0, 2, 8, 42, 256, 1810, 14568, 131642, 1320128, 14551074, 174879880, 2276108362, 31894886208, 478775722802, 7664993150696, 130369025763930, 2347604596782208, 44619881467365442, 892659329531868168, 18750556523491299434, 412601744979927877760, 9491630163800726992722
Offset: 0

Views

Author

Keywords

Comments

Number of permutations p of [n] such that p(k) = k+2 for exactly one k in the range 0 < k < n-1. - Vladeta Jovovic, Nov 30 2007

Crossrefs

Programs

  • Mathematica
    Join[{0,0},With[{nn=30},CoefficientList[Series[(2x Exp[-x])/(1-x)^3, {x,0,nn}],x] Range[0,nn]!]] (* Harvey P. Dale, Nov 16 2013 *)
  • PARI
    C=binomial;
    a(n)=if(n<=2, 0, n! + sum(k=1,n, (-1)^k * ( C(n-1,k)+C(n-2,k-1) )*(n-k)! ) );
    /* Joerg Arndt, Apr 22 2013 */
    
  • Sage
    def A():
        a, b, n  = 1, 1, 1
        yield 0
        while True:
            yield b - a
            n += 1
            a, b = b, (n-2)*a+(n-1)*b
    A018934 = A()
    print([next(A018934) for  in range(24)]) # _Peter Luschny, Jan 30 2017

Formula

From Vladeta Jovovic, Nov 30 2007: (Start)
a(n) = (n-2)*A055790(n-2).
E.g.f.: 2*x*exp(-x)/(1-x)^3. (End)
a(n) = floor((n!+1)/e) - floor(((n-2)!+1)/e), n > 2. - Gary Detlefs, Mar 27 2011
G.f.: (1-x)*x/Q(0) - x, where Q(k) = 1 + x - x*(k+2)/(1 - x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 22 2013
G.f.: G(0)*x - x, where G(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - (1-x*(1+2*k))*(1-x*(3+2*k))/G(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Feb 05 2014
For n > 1, a(n) = (n-1)*A000166(n-1) + (n-2)*A000166(n-2). - Kevin Long, Feb 21 2021

Extensions

More terms from Vladeta Jovovic, Nov 30 2007, corrected Jan 25 2008

A061312 Triangle T[n,m]: T[n,-1] = 0; T[0,0] = 0; T[n,0] = n*n!; T[n,m] = T[n,m-1] - T[n-1,m-1].

Original entry on oeis.org

0, 1, 1, 4, 3, 2, 18, 14, 11, 9, 96, 78, 64, 53, 44, 600, 504, 426, 362, 309, 265, 4320, 3720, 3216, 2790, 2428, 2119, 1854, 35280, 30960, 27240, 24024, 21234, 18806, 16687, 14833, 322560, 287280, 256320, 229080, 205056, 183822, 165016, 148329
Offset: 0

Views

Author

Wouter Meeussen, Jun 06 2001

Keywords

Comments

Appears in the (n,k)-matching problem A076731. [Johannes W. Meijer, Jul 27 2011]

Examples

			0,
1, 1,
4, 3, 2,
18, 14, 11, 9,
96, 78, 64, 53, 44,
600, 504, 426, 362, 309, 265,
4320, 3720, 3216, 2790, 2428, 2119, 1854,
35280, 30960, 27240, 24024, 21234, 18806, 16687, 14833,
		

Crossrefs

Cf. A061018.
From Johannes W. Meijer, Jul 27 2011: (Start)
The row sums equal A193465. (End)

Programs

  • Magma
    [[(&+[(-1)^j*Binomial(k+1,j)*Factorial(n-j+1): j in [0..k+1]]): k in [0..n]]: n in [0..20]]; // G. C. Greubel, Aug 13 2018
  • Maple
    A061312 := proc(n,m): add(((-1)^j)*binomial(m+1,j)*(n+1-j)!, j=0..m+1) end: seq(seq(A061312(n,m), m=0..n), n=0..7); # Johannes W. Meijer, Jul 27 2011
  • Mathematica
    T[n_, k_]:= Sum[(-1)^j*Binomial[k + 1, j]*(n + 1 - j)!, {j, 0, k + 1}]; Table[T[n, k], {n, 0, 100}, {k, 0, n}] // Flatten  (* G. C. Greubel, Aug 13 2018 *)
  • PARI
    for(n=0,20, for(k=0,n, print1(sum(j=0,k+1, (-1)^j*binomial(k+1,j) *(n-j+1)!), ", "))) \\ G. C. Greubel, Aug 13 2018
    

Formula

T[n,m] = T[n,m-1]-T[n-1,m-1] with T[n,-1] = 0 and T[n,0] = A001563(n) = n*n!
T(n,m) = sum(((-1)^j)*binomial(m+1,j)*(n+1-j)!, j=0..m+1) [Johannes W. Meijer, Jul 27 2011]

A129867 Row sums of triangular array T: T(j,k) = k*(j-k)! for k < j, T(j,k) = 1 for k = j; 1 <= k <= j.

Original entry on oeis.org

1, 2, 5, 14, 47, 200, 1073, 6986, 53219, 462332, 4500245, 48454958, 571411271, 7321388384, 101249656697, 1502852293010, 23827244817323, 401839065437636, 7182224591785949, 135607710526966262, 2696935204638786575
Offset: 1

Views

Author

Paul Curtz, May 24 2007

Keywords

Comments

T read by rows is in A130469.
First differences are 1, 3, 9, 33, 153, 873, 5913, ... (see A007489), second differences are 2, 6, 24, 120, 720, 5040, ... (see A000142 ).
First terms of the sequences of m-th differences are 1, 2, 4, 14, 64, ... (see A055790, A047920, A068106).
Antidiagonal sums are 1, 1, 3, 8, 29, 135, ... (see A130470) with first differences 0, 2, 5, 21, 106, ... (see A130471).
Equals the row sums of irregular triangle A182961. - Paul D. Hanna, Mar 05 2012

Examples

			First seven rows of T are
[   1 ]
[   1,   1 ]
[   2,   2,   1 ]
[   6,   4,   3,   1 ]
[  24,  12,   6,   4,   1 ]
[ 120,  48,  18,   8,   5,   1 ]
[ 720, 240,  72,  24,  10,   6,   1 ]
		

Crossrefs

Programs

  • Magma
    m:=21; [ &+([ k*Factorial(j-k): k in [1..j-1] ] cat [ 1 ]): j in [1..m] ]; // Klaus Brockhaus, May 28 2007

Extensions

Edited and extended by Klaus Brockhaus, May 28 2007

A346204 a(n) is the number of permutations on [n] with at least one strong fixed point and at least one small descent.

Original entry on oeis.org

0, 0, 2, 5, 24, 128, 795, 5686, 46090, 418519, 4213098, 46595650, 561773033, 7333741536, 103065052300, 1551392868821, 24902155206164, 424588270621876, 7663358926666175, 145967769353476594, 2926073829112697318, 61577929208485406331, 1357369100658321844470, 31276096500003460511422
Offset: 1

Views

Author

Keywords

Comments

A small descent in a permutation p is a position i such that p(i)-p(i+1)=1.
A strong fixed point is a fixed point (or splitter) p(k)=k such that p(i) < k for i < k and p(j) > k for j > k.

Examples

			For n=4, the a(4)=5 permutations on [4] with strong fixed points and small descents: {(1*, 2*, [4, 3]), (1*, [3, 2], 4*), (1*, <4, 3, 2>), ([2, 1], 3*, 4*), (<3, 2, 1>, 4*)}. *strong fixed point, []small descent, <>consecutive small descents.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways For Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

  • Python
    import math
    bn = [1,1,1]
    wn = [0,0,0]
    kn = [1,1,1]
    def summation(n):
        final = bn[n] - bn[n-1]
        for k in range(4,n+1):
            final -= wn[k-1]*bn[n-k]
        return final
    def smallsum(n):
        final = bn[n-1]
        for k in range(4,n+1):
            final += wn[k-1]*bn[n-k]
        return final
    def derrangement(n):
        finalsum = 0
        for i in range(n+1):
            if i%2 == 0:
                finalsum += math.factorial(n)*1//math.factorial(i)
            else:
                finalsum -= math.factorial(n)*1//math.factorial(i)
        if finalsum != 0:
            return finalsum
        else:
            return 1
    def fixedpoint(n):
        finalsum = math.factorial(n-1)
        for i in range(2,n):
            finalsum += math.factorial(i-i)*math.factorial(n-i-1)
            print(math.factorial(i-i)*math.factorial(n-i-1))
        return finalsum
    def no_cycles(n):
        goal = n
        cycles = [0, 1]
        current = 2
        while current<= goal:
            new = 0
            k = 1
            while k<=current:
                new += (math.factorial(k-1)-cycles[k-1])*(math.factorial(current-k))
                k+=1
            cycles.append(new)
            current+=1
        return cycles
    def total_func(n):
        for i in range(3,n+1):
            bn.append(derrangement(i+1)//(i))
            kn.append(smallsum(i))
            wn.append(summation(i))
        an = no_cycles(n)
        tl = [int(an[i]-kn[i]) for i in range(n+1)]
        factorial = [math.factorial(x) for x in range(0,n+1)]
        print("A346189 :" + str(wn[1:]))
        print("A346198 :" + str([factorial[i]-wn[i]-tl[i]-kn[i] for i in range(n+1)][1:]))
        print("A346199 :" + str(kn[1:]))
        print("A346204 :" + str(tl[1:]))
    total_func(20)

Formula

a(n) = A006932(n) - A346199(n).

A090013 Permanent of (0,1)-matrix of size n X (n+d) with d=3 and n-1 zeros not on a line.

Original entry on oeis.org

4, 16, 84, 536, 4004, 34176, 327604, 3481096, 40585284, 514872176, 7058605844, 103969203576, 1637182717924, 27442553929696, 487806792137844, 9164718013496936, 181446744138509444, 3775570370986139856
Offset: 1

Views

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Mathematica
    t={4,16};Do[AppendTo[t,(n+2)*t[[-1]]+(n-2)*t[[-2]]],{n,3,18}];t (* Indranil Ghosh, Feb 21 2017 *)

Formula

a(n) = (n+2)*a(n-1) + (n-2)*a(n-2), a(1)=4, a(2)=16
a(n) ~ exp(-1) * n! * n^3 / 6. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090015 Permanent of (0,1)-matrix of size n X (n+d) with d=5 and n-1 zeros not on a line.

Original entry on oeis.org

6, 36, 258, 2136, 19998, 208524, 2393754, 29976192, 406446774, 5930064372, 92608986546, 1541044428456, 27216454135758, 508388707585116, 10013199347882058, 207381428863832784, 4505207996358719334
Offset: 1

Views

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Maple
    f:= gfun:-rectoproc({a(n) = (n+4)*a(n-1) + (n-2)*a(n-2),a(1)=6,a(2)=36},a(n),remember):
    map(f, [$1..40]); # Robert Israel, Nov 26 2018
  • Mathematica
    t={6,36};Do[AppendTo[t,(n+4)*t[[-1]]+(n-2)*t[[-2]]],{n,3,17}];t (* Indranil Ghosh, Feb 21 2017 *)
    RecurrenceTable[{a[n] == (n+4)*a[n-1] + (n-2)*a[n-2],
    a[1] == 6, a[2] == 36}, a, {n, 1, 40}] (* Jean-François Alcover, Sep 16 2022, after Robert Israel *)

Formula

a(n) = (n+4)*a(n-1) + (n-2)*a(n-2), a(1)=6, a(2)=36
a(n) ~ exp(-1) * n! * n^5 / 5!. - Vaclav Kotesovec, Nov 30 2017
a(n) = ((n^6+21*n^5+160*n^4+545*n^3+814*n^2+415*n+1)*exp(-1)*Gamma(n, -1)+(-1)^n*(n^5+20*n^4+141*n^3+422*n^2+499*n+154))/120. - Robert Israel, Nov 26 2018

Extensions

Corrected by Jaap Spies, Jan 26 2004

A346189 a(n) is the number of permutations on [n] with no strong fixed points or small descents.

Original entry on oeis.org

0, 0, 2, 6, 34, 214, 1550, 12730, 116874, 1187022, 13219550, 160233258, 2100360778, 29610224590, 446789311934, 7185155686666, 122690711149290, 2217055354281582, 42269657477711198, 847998698508705834, 17857221256001240458, 393839277313540073230, 9078806210245773668990, 218340709713567352161226
Offset: 1

Views

Author

Keywords

Comments

A small descent in a permutation p is a position i such that p(i)-p(i+1)=1.
A strong fixed point is a fixed point (or splitter) p(k)=k such that p(i) < k for i < k and p(j) > k for j > k.

Examples

			For n = 4, the a(4) = 6 permutations on [4] with no strong fixed points or small descents: {(2,3,4,1),(3,4,1,2),(4,1,2,3),(3,1,4,2),(2,4,1,3),(4,2,3,1)}.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways For Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

Formula

For n > 3, a(n) = b(n) - b(n-1) - Sum{i=4..n}(a(i-1)*b(n-i)) where b(n) = A000255(n-1) and b(0) = 1.

A346198 a(n) is the number of permutations on [n] with no strong fixed points but contains at least one small descent.

Original entry on oeis.org

0, 1, 1, 8, 43, 283, 2126, 17947, 168461, 1741824, 19684171, 241506539, 3198239994, 45482655683, 691471698917, 11193266251700, 192238116358427, 3491633681792507, 66875708261486766, 1347168876070616179, 28474546456352896021, 630130731702950549248, 14570725407559756078387, 351411668456841530417027
Offset: 1

Views

Author

Keywords

Comments

A small descent in a permutation p is a position i such that p(i)-p(i+1)=1.
A strong fixed point is a fixed point (or splitter) p(k)=k such that p(i) < k for i < k and p(j) > k for j > k.

Examples

			For n = 4, the a(4) = 8 permutations on [4] with no strong fixed points but has small descents: {([2, 1], [4, 3]), (2, [4, 3], 1), ([3, 2], 4, 1), (3, 4, [2, 1]), (4, 1, [3, 2]), (4, [2, 1], 3), ([4, 3], 1, 2), (<4, 3, 2, 1>)} []small descent, <>consecutive small descents.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways For Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

Formula

For n > 2, a(n) = b(n)-c(n) where b(n) = A052186(n-1), c(n) = A346189(n).

A346199 a(n) is the number of permutations on [n] with at least one strong fixed point and no small descents.

Original entry on oeis.org

1, 1, 1, 5, 19, 95, 569, 3957, 31455, 281435, 2799981, 30666153, 366646995, 4751669391, 66348304849, 992975080813, 15856445382119, 269096399032035, 4836375742967861, 91766664243841393, 1833100630242606203, 38452789552631651191, 845116020421125048153
Offset: 1

Views

Author

Keywords

Comments

A small descent in a permutation p is a position i such that p(i)-p(i+1)=1.
A strong fixed point is a fixed point (or splitter) p(k)=k such that p(i) < k for i < k and p(j) > k for j > k.

Examples

			For n = 4, the a(4) = 5 permutations on [4] with strong fixed points but no small descents: {(1*, 2*, 3*, 4*), (1*, 3, 4, 2), (1*, 4, 2, 3), (2, 3, 1, 4*), (3, 1, 2, 4*)} where * marks strong fixed points.
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways For Your Mathematical Plays, Vol. 1, CRC Press, 2001.

Crossrefs

Programs

Formula

a(n) = b(n-1) + Sum_{i=4..n} A346189(i-1)*b(n-i) where b(n) = A000255(n).
Previous Showing 11-20 of 26 results. Next