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

A231777 Number T(n,k) of permutations of [n] with exactly k ascents from odd to even numbers; triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 8, 14, 2, 54, 60, 6, 162, 402, 150, 6, 1536, 2712, 768, 24, 6144, 19704, 12744, 1704, 24, 75000, 183120, 94320, 10320, 120, 375000, 1473720, 1392720, 365520, 21720, 120, 5598720, 17522640, 13631040, 3011040, 152640, 720, 33592320, 156250800
Offset: 0

Views

Author

Alois P. Heinz, Nov 13 2013

Keywords

Examples

			T(4,0) = 8: 1324, 2413, 2431, 3241, 4132, 4213, 4231, 4321.
T(4,1) = 14: 1243, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 3124, 3142, 3214, 3421, 4123, 4312.
T(4,2) = 2: 1234, 3412.
T(5,2) = 6: 12345, 12534, 34125, 34512, 51234, 53412.
T(6,3) = 6: 123456, 125634, 341256, 345612, 561234, 563412.
Triangle T(n,k) begins:
:  0 :      1;
:  1 :      1;
:  2 :      1,       1;
:  3 :      4,       2;
:  4 :      8,      14,       2;
:  5 :     54,      60,       6;
:  6 :    162,     402,     150,      6;
:  7 :   1536,    2712,     768,     24;
:  8 :   6144,   19704,   12744,   1704,    24;
:  9 :  75000,  183120,   94320,  10320,   120;
: 10 : 375000, 1473720, 1392720, 365520, 21720, 120;
		

Crossrefs

Column k=0 gives: A231601.
Row sums and T(2n,n) give: A000142.
T(n,floor(n/2)) gives: A081123(n+1).
Cf. A004526.

A359039 Number of Wachs permutations of size n.

Original entry on oeis.org

1, 1, 2, 4, 8, 24, 48, 192, 384, 1920, 3840, 23040, 46080, 322560, 645120, 5160960, 10321920, 92897280, 185794560, 1857945600, 3715891200, 40874803200, 81749606400, 980995276800, 1961990553600, 25505877196800, 51011754393600, 714164561510400, 1428329123020800
Offset: 0

Views

Author

Per W. Alexandersson, Dec 13 2022

Keywords

Comments

A Wachs permutation pi is a permutation of [n] such that |pi^{-1}(i) - pi^{-1}(i*)| <= 1, for all 1 <= i <= n-1, where i* is defined as i-1 if i is even, i+1 if i is odd and i+1 <= n, and n otherwise.

Examples

			For n=4, a(n)=8, since we have the 8 Wachs permutations 1234, 1243, 2134, 2143, 3412, 3421, 4312, 4321.
		

Crossrefs

Programs

  • Maple
    A359039 := proc(n)
        local m ;
        m := floor(n/2) ;
        if type(n,'even') then
            m!*2^m ;
        else
            (m+1)!*2^m ;
        end if;
    end proc: # R. J. Mathar, Jul 17 2023
    # second Maple program:
    a:= n-> ceil(n/2)!*2^floor(n/2):
    seq(a(n), n=0..28);  # Alois P. Heinz, Dec 21 2023
  • Mathematica
    a[n_]:=If[EvenQ[n], (n/2)! 2^(n/2), ((n + 1)/2)!*2^((n - 1)/2)]

Formula

If n=2m, then a(n) = m!*2^m, if n=2m+1, then a(n) = (m+1)!*2^m.
a(n) = A081123(n+1)*A016116(n). - Alois P. Heinz, Jan 23 2023
Sum_{n>=0} 1/a(n) = 3*sqrt(e) - 2. - Amiram Eldar, Jan 25 2023
D-finite with recurrence a(n) +2*a(n-1) +(-n-1)*a(n-2) +2*(-n+1)*a(n-3)=0. - R. J. Mathar, Jul 17 2023

A366109 a(n) = floor(n!*(3*floor(n/2)!*ceiling(n/2)! + 3*floor((n+2)/2)!*ceiling((n-2)/2)! - 6*floor(n/2)!*ceiling((n-2)/2)!)^(-1)).

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 26, 46, 92, 168, 333, 616, 1225, 2288, 4558, 8580, 17107, 32413, 64664, 123170, 245832, 470288, 938943, 1802770, 3600207, 6933733, 13849778, 26744400, 53429368, 103411680, 206621384, 400720260, 800747232, 1555737480, 3109074130, 6050090200, 12091800773
Offset: 3

Views

Author

Stefano Spezia, Sep 29 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Floor[n!(3Floor[n/2]!Ceiling[n/2]! + 3Floor[(n+2)/2]!Ceiling[(n-2)/2]! - 6Floor[n/2]!Ceiling[(n-2)/2]!)^(-1)]; Array[a,37,3]

Formula

a(n)/A366107(n) ~ 7/6 (see Remark 3.4 at p. 5 in Czédli).
a(n) ~ c*2^n/sqrt(n), with c = 1/(3*sqrt(2*Pi)) = (2/3)*A218708.

A133922 a(n) is number of permutations (p(1),p(2),p(3),...,p(n)) of (1,2,3,...,n) such that p(k) is coprime to p(n+1-k) for k = all positive integers <= n.

Original entry on oeis.org

1, 2, 2, 16, 16, 192, 192, 6912, 4608, 230400, 230400, 11612160, 11612160, 1199923200, 588349440, 98594979840, 98594979840, 11076328488960, 11076328488960, 2102897147904000, 1076597725593600, 331238941183180800, 331238941183180800, 66325953940291584000, 56326771107377971200
Offset: 1

Views

Author

Leroy Quet, Jan 07 2008

Keywords

Comments

For n = odd integer the middle term of all counted permutations must be 1.
From Robert Israel, Sep 12 2016: (Start)
Consider the graph with vertices [1,...,n] if n is even, [2,...,n] if n is odd, and edges joining coprime integers.
a(n) is A037223(n) times the number of perfect matchings in this graph.
If n is even, a(n) = A037223(n)*A009679(n/2).
If n is an odd prime, a(n) = a(n-1). (End)

Examples

			For n = 6, the permutation (3,2,1,6,4,5) is not counted because p(2)=2 is not coprime to p(5)=4. However, the permutation (3,6,1,4,5,2) is counted because GCD(3,2) = GCD(6,5) = GCD(1,4) = 1.
		

Crossrefs

Programs

  • Maple
    M:= proc(A) option remember;
        local n,t,i,Ai,Ap,inds,isrt,As;
        n:= nops(A);
        if n = 0 then return 1 fi;
        t:= 0;
        for i in A[1] do
          inds:= [$2..i-1,$i+1..n];
          Ai:= subs([1=NULL,i=NULL,seq(inds[i]=i,i=1..n-2)],A[inds]);
          isrt:= sort([$1..n-2],(r,s) -> nops(Ai(r)) <= nops(Ai(s)),output=permutation);
          Ai:= subs([seq(isrt[i]=i,i=1..n-2)],Ai[isrt]);
          t:= t + procname(Ai);
        od;
        t;
    end proc:
    F:= proc(n) local A;
      if n::odd then
        if isprime(n) then return procname(n-1) fi;
        A:= [seq(select(t -> igcd(t+1,i+1)=1, [$1..i-1,$i+1..n-1]),i=1..n-1)];
      else
        A:= [seq(select(t -> igcd(t,i)=1,[$1..i-1,$i+1..n]),i=1..n)]
      fi;
      M(A)*floor(n/2)!*2^floor(n/2)
    end proc;
    seq(F(n),n=1..27); # Robert Israel, Sep 12 2016

Extensions

a(6)-a(15) from Sean A. Irvine, May 17 2010
a(16)-a(25) from Robert Israel, Sep 12 2016

A249138 Triangular array read by rows: row n gives the coefficients of the polynomial p(n,x) defined in Comments.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 6, 5, 7, 1, 1, 6, 18, 8, 10, 1, 1, 24, 26, 46, 12, 14, 1, 1, 24, 96, 58, 86, 16, 18, 1, 1, 120, 154, 326, 118, 156, 21, 23, 1, 1, 120, 600, 444, 756, 198, 246, 26, 28, 1, 1, 720, 1044, 2556, 1152, 1692, 324, 384, 32, 34, 1, 1
Offset: 0

Views

Author

Clark Kimberling, Oct 22 2014

Keywords

Comments

The polynomial p(n,x) is the numerator of the rational function given by f(n,x) = x + floor((n+2)/2)/f(n-1,x), where f(0,x) = 1.
(Sum of numbers in row n) = A056952(n+2) for n >= 0.
(Column 1) is essentially A081123 (repeated factorials).

Examples

			f(0,x) = 1/1, so that p(0,x) = 1;
f(1,x) = (1 + x)/1, so that p(1,x) = 1 + x;
f(2,x) = (2 + x + x^2)/(1 + x), so that p(2,x) = 2 + x + x^2.
First 6 rows of the triangle of coefficients:
  1
  1    1
  2    1    1
  2    4    1    1
  6    5    7    1    1
  6    18   8    10   1   1
		

Crossrefs

Programs

  • Mathematica
    z = 15; p[x_, n_] := x + Floor[(n+1)/2]/p[x, n - 1]; p[x_, 1] = 1;
    t = Table[Factor[p[x, n]], {n, 1, z}]
    u = Numerator[t]
    TableForm[Table[CoefficientList[u[[n]], x], {n, 1, z}]] (* A249138 array *)
    Flatten[CoefficientList[u, x]] (* A249138 sequence *)

A355986 a(n) = Sum_{k=1..n} floor(n/k)!.

Original entry on oeis.org

1, 3, 8, 28, 125, 731, 5052, 40352, 362917, 3628935, 39916936, 479002360, 6227021561, 87178296283, 1307674373184, 20922789928484, 355687428136485, 6402373706091651, 121645100409195652, 2432902008180269688, 51090942171713074013, 1124000727777647602015
Offset: 1

Views

Author

Seiichi Manyama, Jul 22 2022

Keywords

Examples

			a(6) = 6! + 3! + 2! + 1! + 1! + 1! = 731.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Floor[n/k]!, {k, 1, n}]; Array[a, 22] (* Amiram Eldar, Jul 22 2022 *)
  • PARI
    a(n) = sum(k=1, n, (n\k)!);

A361522 The aerated factorial numbers.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 6, 0, 24, 0, 120, 0, 720, 0, 5040, 0, 40320, 0, 362880, 0, 3628800, 0, 39916800, 0, 479001600, 0, 6227020800, 0, 87178291200, 0, 1307674368000, 0, 20922789888000, 0, 355687428096000, 0, 6402373705728000, 0, 121645100408832000, 0, 2432902008176640000
Offset: 0

Views

Author

Peter Luschny, Mar 14 2023

Keywords

Comments

An aerated version of A000142, which is the main entry for this sequence.

Crossrefs

Programs

  • Maple
    egf := (z/2)*Pi^(1/2)*erf(z/2)*exp((z/2)^2) + 1:
    ser := series(egf, z, 42): seq(n!*coeff(ser, z, n), n = 0..40);
  • Mathematica
    a[n_] := If[OddQ[n], 0, (n/2)!]; Array[a, 41, 0] (* Amiram Eldar, Mar 14 2023 *)

Formula

a(n) = n! * [z^n] (z/2)*Pi^(1/2)*erf(z/2)*exp((z/2)^2) + 1.
a(n) = n! * [z^n] 1 + 2*u*exp(u)*hypergeom([1/2], [3/2], -u), where u = (z/2)^2.

A373829 Number of inefficient arrangements in A373182, where inefficient means that the maximum number of persons that a seating arrangement can hold is not achieved.

Original entry on oeis.org

0, 0, 1, 0, 6, 2, 36, 24, 246, 240, 1920, 2424, 16920, 25920, 166440, 297360, 1809360, 3669840, 21551040, 48666240, 279180720, 691649280, 3908580480, 10501787520, 58813776000, 169809696000, 946627274880, 2914924320000, 16228733875200, 52963370208000
Offset: 1

Views

Author

Enrique Navarrete, Jun 19 2024

Keywords

Comments

The maximum number of persons that can be seated in the arrangements in A373182 in n seats is ceiling(n/2).
The seatings here are maximal in the sense that no additional person can be seated without breaking the condition in A373182, but maximum seatings are excluded.
The ratio a(n)/A373182(n) -> 1 as n -> infinity (at a much slower initial rate for even n).

Examples

			a(5)=6 are the following seatings, where _ denotes an empty seat. Seatings of 3 people are the maximum for n=5 and those are not included.
    1 _ _ 2 _
    _ 1 _ 2 _
    _ 1 _ _ 2
    _ 2 _ 1 _
    2 _ _ 1 _
    _ 2 _ _ 1.
For n=9 seats the maximum number of persons that can be seated is 5, hence examples of inefficient arrangements are:
    3 _ 2 _ 1 _ _ 4 _
    _ 3 _ _ 1 _ _ 2 _.
		

Crossrefs

Formula

a(n) = A373182(n) - (ceiling((n+1)/2))!.
Previous Showing 11-18 of 18 results.