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-4 of 4 results.

A092186 a(n) = 2(m!)^2 for n = 2m and m!(m+1)! for n = 2m+1.

Original entry on oeis.org

2, 1, 2, 2, 8, 12, 72, 144, 1152, 2880, 28800, 86400, 1036800, 3628800, 50803200, 203212800, 3251404800, 14631321600, 263363788800, 1316818944000, 26336378880000, 144850083840000, 3186701844480000, 19120211066880000, 458885065605120000, 2982752926433280000
Offset: 0

Views

Author

N. J. A. Sloane, based on correspondence from Hugo Pfoertner and Rob Pratt, Apr 02 2004

Keywords

Comments

Singmaster's problem: "A salesman's office is located on a straight road. His n customers are all located along this road to the east of the office, with the office of customer k at distance k from the salesman's office. The salesman must make a driving trip whereby he leaves the office, visits each customer exactly once, then returns to the office.
"Because he makes a profit on his mileage allowance, the salesman wants to drive as far as possible during his trip. What is the maximum possible distance he can travel on such a trip and how many different such trips are there?
"Assume that if the travel plans call for the salesman to visit customer j immediately after he visits customer i, then he drives directly from i to j."
The solution to the first question is twice A002620(n-1); the solution to the second question is a(n).
Number of permutation of [n] with no pair of consecutive elements of the same parity. - Vladeta Jovovic, Nov 26 2007

References

  • A. O. Munagi, Alternating subsets and permutations, Rocky Mountain J. Math. 40 (6) (2010) 1965-1977 doi:10.1216/RJM-2010-40-6-1965, Corollary 3.2.
  • David Singmaster, Problem 1654, Mathematics Magazine 75 (October 2002). Solution in Mathematics Magazine 76 (October 2003).

Crossrefs

Cf. A152877.
Row sums of A125300. - Alois P. Heinz, Nov 18 2013

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 2-n,
          (n*(3*n-1)*(n-1)*a(n-2) -4*a(n-1))/(12*n-16))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 11 2013
  • Mathematica
    f[n_] := If[EvenQ[n], 2 (n/2)!^2, ((n + 1)/2)! ((n - 1)/2)!]; Table[
    f[n], {n, 0, 25}] (* Geoffrey Critzer, Aug 24 2013 *)

A047677 Row 2 of square array defined in A047675: 2*n!*(n+1)!.

Original entry on oeis.org

2, 4, 24, 288, 5760, 172800, 7257600, 406425600, 29262643200, 2633637888000, 289700167680000, 38240422133760000, 5965505852866560000, 1085722065221713920000, 228001633696559923200000, 54720392087174381568000000, 14883946647711431786496000000
Offset: 0

Views

Author

Keywords

Comments

a(n) = A152877(2n+1, 2n-2) for n > 0. - Alois P. Heinz, Nov 10 2013

Crossrefs

Programs

  • Maple
    a:= proc(n) a(n):= `if`(n=0, 2, n*(n+1) * a(n-1)) end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Nov 11 2013
  • Mathematica
    2*Times@@@Partition[Range[0,20]!,2,1] (* Harvey P. Dale, Sep 25 2017 *)

A152876 Number of permutations of {1,2,...,n} having no consecutive triples of the form (odd, even, odd) or (even, odd, even).

Original entry on oeis.org

1, 1, 2, 4, 16, 60, 288, 1584, 10368, 74880, 604800, 5356800, 51840000, 544320000, 6147187200, 74579097600, 962415820800, 13241346048000, 192255565824000, 2957575348224000, 47721518530560000, 811595019755520000, 14407079038894080000, 268390402745794560000
Offset: 0

Views

Author

Emeric Deutsch, Dec 17 2008

Keywords

Comments

Column 0 of A152877.

Examples

			a(3) = 4 because we have 132, 213, 231 and 312.
		

Crossrefs

Cf. A152877.

Programs

  • Maple
    ae := proc (n) options operator, arrow: 2*(sum((n^2-3*n*j+3*j^2)*binomial(n-j, j)^2/(n-j)^2, j = 0 .. floor((1/2)*n))) end proc: ao := proc (n) options operator, arrow: sum(binomial(n+1-k, k)*binomial(n-k, k)*(2*n^2+2*n-6*k*n-3*k+6*k^2)/((n+1-k)*(n-k)), k = 0 .. floor((1/2)*n)) end proc: a := proc (n) if `mod`(n, 2) = 0 then factorial((1/2)*n)^2*ae((1/2)*n) else factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2)*ao((1/2)*n-1/2) end if end proc: 1, 1, seq(a(n), n = 2 .. 22);
    # second Maple program:
    b:= proc(o, u, t) option remember; `if`(u+o=0, 1,
          `if`(t=4, 0, o*b(o-1, u, `if`(t=3, 5, 2)))+
          `if`(t=5, 0, u*b(o, u-1, `if`(t=2, 4, 3))))
        end:
    a:= n-> b(ceil(n/2), floor(n/2), 1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 11 2013
  • Mathematica
    b[o_, u_, t_] := b[o, u, t] = If[u+o == 0, 1, If[t==4, 0, o*b[o-1, u, If[t==3, 5, 2]]] + If[t==5, 0, u*b[o, u-1, If[t==2, 4, 3]]]]; a[n_] := b[Ceiling[n/2], Floor[n/2], 1]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 29 2015, after Alois P. Heinz *)

Formula

a(2n) = (n!)^2*Sum_{j=0..floor(n/2)} (binomial(n-j, j))^2*(2*n^2 - 6*j*n + 6*j^2)/(n-j)^2;
a(2n+1) = n!*(n+1)!*Sum_{j=1..floor(n/2)} binomial(n+1-j, j)*binomial(n-j, j)*(2*n^2 + 2*n - 6*j*n - 3*j + 6*j^2)/((n+1-j)*(n-j)).
a(n) ~ 2 * 5^(-1/4) * ((1+sqrt(5))/4)^n * n!. - Vaclav Kotesovec, Sep 03 2014

A329550 Total number of consecutive triples of the form (odd, even, odd) or (even, odd, even) in all permutations of [n].

Original entry on oeis.org

0, 0, 0, 2, 16, 108, 864, 7200, 69120, 705600, 8064000, 97977600, 1306368000, 18441561600, 281652940800, 4533271142400, 78111748915200, 1412288317440000, 27115935694848000, 544201764986880000, 11524272670310400000, 254238259854458880000, 5887622859787468800000
Offset: 0

Views

Author

Alois P. Heinz, Nov 16 2019

Keywords

Comments

All terms are even.

Examples

			a(3) = 2: 123, 321.
		

Crossrefs

Cf. A152877.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [0$3, 2, 16][n+1],
         (n-2)*(2*(n-4)*a(n-1)+(n-3)^2*n*a(n-2))/(n-3)/(n-4))
        end:
    seq(a(n), n=0..30);
  • Mathematica
    a[n_] := a[n] = If[n < 5, {0, 0, 0, 2, 16}[[n+1]],
         (n-2)*(2*(n-4)*a[n-1] + (n-3)^2*n*a[n-2])/(n-3)/(n-4)];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 21 2022, after Alois P. Heinz *)

Formula

a(n) = Sum_{k>=1} k * A152877(n,k).
a(n) ~ n! * n / 4. - Vaclav Kotesovec, Nov 19 2019
Showing 1-4 of 4 results.