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 71-80 of 163 results. Next

A240796 Total number of occurrences of the pattern 1<2 in all preferential arrangements (or ordered partitions) of n elements.

Original entry on oeis.org

0, 1, 15, 186, 2330, 31065, 447405, 6979588, 117745668, 2141106795, 41810587775, 873474855726, 19451904450654, 460209050303821, 11531197020389025, 305122289460210120, 8503747639606509128, 249020038061419770783, 7645072502094118876755, 245564189847880300238290
Offset: 1

Views

Author

N. J. A. Sloane, Apr 13 2014

Keywords

Comments

There are A000670(n) preferential arrangements of n elements - see A000670, A240763.
The number that avoid the pattern 1<2 is 2^(n-1).
The total number of occurrences of the pattern 1<2 in all permutations on n elements is (n-1)*(n-1)! (cf. A010027, A001563).

Examples

			The 13 preferential arrangements on 3 points and the number of times the pattern 1<2 occurs are:
1<2<3, 3
1<3<2, 2
2<1<3, 2
2<3<1, 1
3<1<2, 1
3<2<1, 0
1=2<3, 2
1=3<2, 1
2=3<1, 0
1<2=3, 2
2<1=3, 1
3<1=2, 0
1=2=3, 0,
for a total of a(3) = 15.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, [1, 0], add((p-> p+
          [0, p[1]*j*t/2])(b(n-j, t+j))*binomial(n, j), j=1..n))
        end:
    a:= n-> b(n, 0)[2]:
    seq(a(n), n=1..25);  # Alois P. Heinz, Dec 08 2014
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, {1, 0}, Sum[Function[{p}, p + {0, p[[1]]*j*t/2}][b[n - j, t + j]]*Binomial[n, j], {j, 1, n}]]; a[n_] := b[n, 0][[2]]; Table[a[n], {n, 1, 25}] (* Jean-François Alcover, Jun 08 2015, after Alois P. Heinz *)

Formula

a(n) ~ n! * n^2 / (8 * (log(2))^(n+1)). - Vaclav Kotesovec, May 03 2015
a(n) = Sum_{k=0..binomial(n,2)} k * A381299(n,k). - Alois P. Heinz, Feb 22 2025

Extensions

a(8)-a(20) from Alois P. Heinz, Dec 08 2014

A094792 a(n) = (1/n!)*A001565(n).

Original entry on oeis.org

2, 11, 32, 71, 134, 227, 356, 527, 746, 1019, 1352, 1751, 2222, 2771, 3404, 4127, 4946, 5867, 6896, 8039, 9302, 10691, 12212, 13871, 15674, 17627, 19736, 22007, 24446, 27059, 29852, 32831, 36002, 39371, 42944, 46727, 50726, 54947, 59396, 64079
Offset: 0

Views

Author

Benoit Cloitre, Jun 11 2004

Keywords

Comments

Number of injections from {1,2,3} to {1,2,...,n} with no fixed points. - Fiona T. Brunk (fbrunk(AT)mcs.st-and.ac.uk), May 23 2006

Crossrefs

Programs

Formula

a(n) = n^3 + 3*n^2 + 5*n + 2.
a(n) = Sum_{i=0..3} (-1)^i*binomial(3,i)*(n-i)!/(n-3)!. - Fiona T. Brunk (fbrunk(AT)mcs.st-and.ac.uk), May 23 2006
G.f.: (x^3+3*x+2) / (x-1)^4. - Colin Barker, Jun 15 2013
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Fung Lam, Apr 17 2014
P-recursive: n*a(n) = (n+4)*a(n-1) - a(n-2) with a(0) = 2 and a(1) = 11. Cf. A094791. - Peter Bala, Jul 25 2021

A239069 Decimal expansion of gamma - Ei(-1).

Original entry on oeis.org

7, 9, 6, 5, 9, 9, 5, 9, 9, 2, 9, 7, 0, 5, 3, 1, 3, 4, 2, 8, 3, 6, 7, 5, 8, 6, 5, 5, 4, 2, 5, 2, 4, 0, 8, 0, 0, 7, 3, 2, 0, 6, 6, 2, 9, 3, 4, 6, 8, 3, 1, 8, 0, 6, 3, 8, 3, 7, 4, 5, 8, 4, 7, 9, 5, 8, 4, 3, 6, 4, 2, 5, 3, 3, 6, 8, 0, 6, 2, 1, 5, 6, 5, 9, 1, 5, 7, 3, 1, 4, 3, 2, 6, 8, 8, 3, 9, 9, 9, 4
Offset: 0

Views

Author

Jonathan Sondow, Mar 12 2014

Keywords

Comments

See crossrefs sequences for other comments, references, links, and formulas.

Examples

			0.7965995992970531342836758655425240800732066293468...
		

References

  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 37, table 37:7:1 at page 355.

Crossrefs

Programs

  • Mathematica
    RealDigits[EulerGamma - ExpIntegralEi[-1], 10, 100][[1]]
  • PARI
    Euler + eint1(1,1)[1] \\ Michel Marcus, Aug 01 2020

Formula

Equals (the Euler-Mascheroni constant) - (the exponential integral at -1) = A001620 + A099285.
Equals (the Euler-Mascheroni constant) + (Gompertz's constant / e) = A001620 + (A073003 / A001113).
Equals Sum_{n>=1} (-1)^(n-1) / A001563(n) = Sum_{n>=1} (-1)^(n-1) / (n*n!).
Equals -Integral_{x=0..1} log(x)/exp(x) dx. - Amiram Eldar, Aug 01 2020
Equals (1/e) * Sum_{k>=1} H(k)/k!, where H(k) = A001008(k)/A002805(k) is the k-th harmonic number. - Amiram Eldar, Jun 25 2021

A255566 a(0) = 0; after which, a(2n) = A255411(a(n)), a(2n+1) = A256450(a(n)).

Original entry on oeis.org

0, 1, 4, 2, 18, 6, 12, 3, 96, 24, 48, 8, 72, 15, 16, 5, 600, 120, 240, 30, 360, 56, 60, 10, 480, 87, 88, 20, 90, 21, 22, 7, 4320, 720, 1440, 144, 2160, 270, 288, 36, 2880, 416, 420, 67, 432, 73, 66, 13, 3600, 567, 568, 107, 570, 109, 108, 26, 576, 111, 112, 27, 114, 28, 52, 9, 35280, 5040, 10080, 840, 15120, 1584, 1680, 168
Offset: 0

Views

Author

Antti Karttunen, May 05 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A255411(n), and each right hand child as A256450(n), when parent contains n >= 1:
0
|
...................1...................
4 2
18......../ \........6 12......../ \........3
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
96 24 48 8 72 15 16 5
600 120 240 30 360 56 60 10 480 87 88 20 90 21 22 7
etc.
Because all terms of A255411 are even it means that odd terms can occur only in odd positions (together with some even terms, for each one of which there is a separate infinite cycle), while terms in even positions are all even.
After its initial 1, A255567 seems to give all the terms like 2, 3, 12, ... where the left hand child of the right hand child is one more than the right hand child of the left hand child (as for 2: 16 = 15+1, as for 3: 22 = 21+1, as for 12: 88 = 87+1).

Crossrefs

Inverse: A255565.
Cf. also A255567 and arrays A257503, A257505.
Related or similar permutations: A273666, A273667.

Formula

a(0) = 0; after which, a(2n) = A255411(a(n)), a(2n+1) = A256450(a(n)).
Other identities:
For all n >= 0, a(2^n) = A001563(n+1). [The leftmost branch of the binary tree is given by n*n!]
For all n >= 0, a(A083318(n)) = A000142(n+1). [And the next innermost vertices by (n+1)! This follows because A256450(n*n! - 1) = (n+1)! - 1.]
For all n >= 1, A257679(a(n)) = A001511(n).

Extensions

Formula changed because of the changed starting offset of A256450 - Antti Karttunen, May 30 2016

A285793 Sum T(n,k) of the k-th entries in all cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 18, 13, 5, 96, 83, 43, 18, 600, 582, 342, 192, 84, 4320, 4554, 2874, 1824, 1068, 480, 35280, 39672, 26232, 17832, 11784, 7080, 3240, 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200, 3265920, 4044240, 2834640, 2078640, 1534320, 1110960, 765360, 473760, 221760
Offset: 1

Views

Author

Alois P. Heinz, Apr 26 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,2) = 13 because the sum of the second entries in all cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 2+3+2+3+3+0 = 13.
Triangle T(n,k) begins:
:      1;
:      4,      2;
:     18,     13,      5;
:     96,     83,     43,     18;
:    600,    582,    342,    192,     84;
:   4320,   4554,   2874,   1824,   1068,   480;
:  35280,  39672,  26232,  17832,  11784,  7080,  3240;
: 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200;
		

Crossrefs

Columns k=1-2 give: A001563, A285795.
Main diagonal and first lower diagonal give: A038720(n-1) (for n>1), A286175.
Row sums give A000142 * A000217 = A180119.

Formula

T(n,1) = n * n!.
T(n,n) = floor((n-1)!*(n+2)/2).

A318215 Expansion of e.g.f. exp(x/(1 + x)^2).

Original entry on oeis.org

1, 1, -3, 7, 1, -219, 2581, -22973, 162177, -554039, -10506419, 343049631, -6846400703, 113528248237, -1609627861659, 17371462450651, -36066494745599, -5681921495461743, 243263898097515037, -7398126521141652809, 193119003246643917441, -4476119490014676723659, 89171014860669488040757
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 21 2018

Keywords

Crossrefs

Programs

  • Maple
    A318215 := proc(n)
        add((-1)^(n-k)*binomial(n+k-1,2*k-1)*n!/k!,k=0..n) ;
    end proc:
    seq(A318215(n),n=0..42) ; # R. J. Mathar, Aug 20 2021
  • Mathematica
    nmax = 22; CoefficientList[Series[Exp[x/(1 + x)^2], {x, 0, nmax}], x] Range[0, nmax]!
    Table[Sum[(-1)^(n - k) Binomial[n + k - 1, 2 k - 1] n!/k!, {k, 0, n}], {n, 0, 22}]
    a[n_] := a[n] = Sum[(-1)^(k + 1) k k! Binomial[n - 1, k - 1] a[n - k], {k, 1, n}]; a[0] = 1; Table[a[n], {n, 0, 22}]
    Join[{1}, Table[(-1)^(n + 1) n n! HypergeometricPFQ[{1 - n, 1 + n}, {3/2, 2}, 1/4], {n, 22}]]

Formula

E.g.f.: Product_{k>=1} exp((-1)^(k+1)*k*x^k).
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n+k-1,2*k-1)*n!/k!.
a(0) = 1; a(n) = Sum_{k=1..n} (-1)^(k+1)*k*k!*binomial(n-1,k-1)*a(n-k).
D-finite with recurrence a(n) +(3*n-4)*a(n-1) +(n-1)*(3*n-5)*a(n-2) +(n-1)*(n-2)*(n-3)*a(n-3)=0. - R. J. Mathar, Aug 20 2021

A094795 a(n) = (1/n!)*A023043(n).

Original entry on oeis.org

265, 2119, 9403, 30637, 81901, 190435, 398959, 770713, 1395217, 2394751, 3931555, 6215749, 9513973, 14158747, 20558551, 29208625, 40702489, 55744183, 75161227, 99918301, 131131645, 170084179, 218241343, 277267657, 349044001, 435685615
Offset: 0

Views

Author

Benoit Cloitre, Jun 11 2004

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{7,-21,35,-35,21,-7,1},{265,2119,9403,30637,81901,190435,398959},30] (* Harvey P. Dale, Aug 29 2023 *)

Formula

a(n) = n^6 + 15*n^5 + 100*n^4 + 355*n^3 + 694*n^2 + 689*n + 265.
G.f.: -(265 + 264*x + 135*x^2 + 40*x^3 + 15*x^4 + x^6)/(x-1)^7. - R. J. Mathar, Nov 15 2019
P-recursive: n*a(n) = (n+7)*a(n-1) - a(n-2) with a(0) = 265 and a(1) = 2119. Cf. A094791. - Peter Bala, Jul 25 2021

A143946 Triangle read by rows: T(n,k) is the number of permutations of [n] for which the sum of the positions of the left-to-right maxima is k (1 <= k <= n(n+1)/2).

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 2, 1, 0, 1, 6, 0, 6, 3, 2, 3, 2, 1, 0, 1, 24, 0, 24, 12, 8, 18, 8, 10, 3, 6, 3, 2, 1, 0, 1, 120, 0, 120, 60, 40, 90, 64, 50, 39, 42, 23, 28, 13, 10, 8, 6, 3, 2, 1, 0, 1, 720, 0, 720, 360, 240, 540, 384, 420, 234, 372, 198, 208, 168, 124, 98, 75, 60, 35, 34, 13, 16, 8, 6, 3
Offset: 1

Views

Author

Emeric Deutsch, Sep 21 2008

Keywords

Comments

Row n contains n*(n+1)/2 = A000217(n) entries.
Sum of entries in row n = n! = A000142(n).

Examples

			T(4,6)=3 because we have 1243, 1342 and 2341 with left-to-right maxima at positions 1,2,3.
Triangle starts:
   1;
   1,  0,  1;
   2,  0,  2,  1,  0,  1;
   6,  0,  6,  3,  2,  3,  2,  1,  0,  1;
  24,  0, 24, 12,  8, 18,  8, 10,  3,  6,  3,  2,  1,  0,  1;
  ...
		

Crossrefs

T(n,n) gives A368246.

Programs

  • Maple
    P:=proc(n) options operator, arrow: sort(expand(product(t^j+j-1,j=1..n))) end proc: for n to 7 do seq(coeff(P(n),t,i),i=1..(1/2)*n*(n+1)) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, 1,
          expand(b(n-1)*(x^n+n-1)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n)):
    seq(T(n), n=1..7);  # Alois P. Heinz, Aug 05 2020
  • Mathematica
    row[n_] := CoefficientList[Product[t^k + k - 1, {k, 1, n}], t] // Rest;
    Array[row, 7] // Flatten (* Jean-François Alcover, Nov 28 2017 *)

Formula

T(n,1) = T(n,3) = (n-1)! for n>=2.
Sum_{k=1..n*(n+1)/2} k * T(n,k) = n! * n = A001563(n).
Generating polynomial of row n is t(t^2+1)(t^3+2)...(t^n+n-1).
Sum_{k=1..n*(n+1)/2} (n*(n+1)/2-k) * T(n,k) = A001804(n). - Alois P. Heinz, Dec 19 2023

A212598 a(n) = n - m!, where m is the largest number such that m! <= n.

Original entry on oeis.org

0, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
Offset: 1

Views

Author

N. J. A. Sloane, May 22 2012

Keywords

Comments

The m in definition is given by A084558(n).
Sequence consists of numbers 0..A001563(n)-1 followed by numbers 0..A001563(n+1)-1, and so on. - Antti Karttunen, Dec 17 2012

Crossrefs

Programs

  • Maple
    f:=proc(n) local i; for i from 0 to n do if i! > n then break; fi; od; n-(i-1)!; end;
    [seq(f(n),n=1..70)];
  • PARI
    a(n)=my(m); while(m++!<=n,); n-(m-1)! \\ Charles R Greathouse IV, Sep 02 2015
  • Scheme
    (define (A212598 n) (- n (A000142 (A084558 n))))
    

Formula

a(n) = n-A000142(A084558(n)). - Antti Karttunen, Dec 17 2012

A227550 A triangle formed like Pascal's triangle, but with factorial(n) on the borders instead of 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 6, 4, 4, 6, 24, 10, 8, 10, 24, 120, 34, 18, 18, 34, 120, 720, 154, 52, 36, 52, 154, 720, 5040, 874, 206, 88, 88, 206, 874, 5040, 40320, 5914, 1080, 294, 176, 294, 1080, 5914, 40320, 362880, 46234, 6994, 1374, 470, 470, 1374, 6994, 46234, 362880, 3628800
Offset: 0

Views

Author

Vincenzo Librandi, Aug 04 2013

Keywords

Comments

A003422 gives the second column (after 0).

Examples

			Triangle begins:
       1;
       1,     1;
       2,     2,    2;
       6,     4,    4,    6;
      24,    10,    8,   10,  24;
     120,    34,   18,   18,  34, 120;
     720,   154,   52,   36,  52, 154,  720;
    5040,   874,  206,   88,  88, 206,  874, 5040;
   40320,  5914, 1080,  294, 176, 294, 1080, 5914, 40320;
  362880, 46234, 6994, 1374, 470, 470, 1374, 6994, 46234, 362880;
		

Crossrefs

Cf. similar triangles with t on the borders: A007318 (t = 1), A028326 (t = 2), A051599 (t = prime(n)), A051601 (t = n), A051666 (t = n^2), A108617 (t = fibonacci(n)), A134636 (t = 2n+1), A137688 (t = 2^n), A227075 (t = 3^n).
Cf. A003422.
Cf. A227791 (central terms), A001563, A074911.

Programs

  • Haskell
    a227550 n k = a227550_tabl !! n !! k
    a227550_row n = a227550_tabl !! n
    a227550_tabl = map fst $ iterate
       (\(vs, w:ws) -> (zipWith (+) ([w] ++ vs) (vs ++ [w]), ws))
       ([1], a001563_list)
    -- Reinhard Zumkeller, Aug 05 2013
    
  • Magma
    function T(n,k)
      if k eq 0 or k eq n then return Factorial(n);
      else return T(n-1,k-1) + T(n-1,k);
      end if; return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 02 2021
    
  • Mathematica
    t = {}; Do[r = {}; Do[If[k == 0||k == n, m = n!, m = t[[n, k]] + t[[n, k + 1]]]; r = AppendTo[r, m], {k, 0, n}]; AppendTo[t, r], {n, 0, 10}]; t = Flatten[t]
  • Sage
    def T(n,k): return factorial(n) if (k==0 or k==n) else T(n-1, k-1) + T(n-1, k)
    flatten([[T(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 02 2021

Formula

From G. C. Greubel, May 02 2021: (Start)
T(n, k) = T(n-1, k-1) + T(n-1, k) with T(n, 0) = T(n, n) = n!.
Sum_{k=0..n} T(n, k) = 2^n * (1 +Sum_{j=1..n-1} j*j!/2^j) = A140710(n). (End)
Previous Showing 71-80 of 163 results. Next