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 21-30 of 73 results. Next

A073333 Decimal expansion of 1/(e - 1) = Sum_{k >= 1} exp(-k).

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 22 2002

Keywords

Comments

The value of the general continued fraction with the partial numerators (A000027) and the partial denominators (A000027). The value of the fractional limit of the numerators (A000166) and the denominators (A002467). Abs(A002467/(e-1)-A000166)->0. - Seiichi Kirikami, Oct 30 2011

Examples

			0.581976706869326424385002005109011558546869301075396136266787059648...
		

References

  • Calvin C. Clawson, Mathematical Mysteries: The Beauty and Magic of Numbers, Springer, 2013. See p. 225.
  • Wolfram Research, Mathematica, Version 4.1.0.0, Help Browser, under the function NSumExtraTerms

Crossrefs

Programs

  • Magma
    1/(Exp(1) - 1); // G. C. Greubel, Apr 09 2018
  • Maple
    h:=x->sum(1/exp(n),n=1..x); evalf[110](h(1500)); evalf[110](h(4000));
  • Mathematica
    RealDigits[N[Sum[Exp[-n], {n, 1, Infinity}], 120]][[1]]
    RealDigits[1/(E - 1), 10, 120][[1]] (* Eric W. Weisstein, May 08 2013 *)
  • PARI
    suminf(k=1,exp(-k)) \\ Charles R Greathouse IV, Oct 04 2011
    
  • PARI
    1/(exp(1)-1) \\ Charles R Greathouse IV, Oct 04 2011
    

Formula

Equals 1/(exp(1)-1). - Joseph Biberstine (jrbibers(AT)indiana.edu), Nov 03 2004
Also the unique real solution to log(1+x) - log(x) = 1. Equals 1-1/(1+1/(exp(1)-2)). Continued fraction is [0:1, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, ...]. - Gerald McGarvey, Aug 14 2004
Equals Sum_{n>=0} B_n/n!, where B_n is a Bernoulli number. - Fredrik Johansson, Oct 18 2006
1/(e-1) = 1/(1+2/(2+3/(3+4/(4+5/(5+...(continued fraction)))))). - Philippe Deléham, Mar 09 2013
Equals Integral_{x=0..oo} floor(x)*exp(-x). - Jean-François Alcover, Mar 20 2013
From Peter Bala, Oct 09 2013: (Start)
Equals (1/2)*Sum_{n >= 0} 1/sinh(2^n). (Gould, equation 22).
Define s(n) = Sum_{k = 1..n} 1/k! for n >= 1. Then 1/(e - 1) = 1 - Sum_{n >= 1} 1/( (n+1)!*s(n)*s(n+1) ) is a rapidly converging series of rationals (see A194807). Equivalently, 1/(e - 1) = 1 - 1!/(1*3) - 2!/(3*10) - 3!/(10*41) - ..., where [1, 3, 10, 41, ... ] is A002627.
We also have the alternating series 1/(e - 1) = 1!/(1*1) - 2!/(1*4) + 3!/(4*15) - 4!/(15*76) + ..., where [1, 1, 4, 15, 76, ...] is A002467. (End)
From Vaclav Kotesovec, Oct 13 2018: (Start)
Equals A185393 - 1.
Equals -LambertW(exp(1/(1 - exp(1))) / (1 - exp(1))).
Equals -1 - LambertW(-1, exp(1/(1 - exp(1))) / (1 - exp(1))). (End)
From Gleb Koloskov, Sep 03 2021: (Start)
Equals (coth(1/2)-1)/2 = (A307178-1)/2.
Equals 1/2 + 2*Integral_{x=0..oo} sin(x)/(exp(2*Pi*x)-1) dx.
Equals 1/2 + (1/Pi)*Integral_{x=0..1} sin(log(x)/(2*Pi))/(x-1) dx. (End)
Equals -lim_{n->oo} zeta(1-n, n)*n^(1 - n). - Vaclav Kotesovec and Peter Luschny, Nov 05 2021
Equals Integral_{x=0..1} floor(-log(x)) dx (see Redmond link). - Amiram Eldar, Oct 03 2023
Equals 1/2 + Sum_{k>=2} tanh(1/2^k)/2^k. - Antonio Graciá Llorente, Jan 21 2024

Extensions

Entry revised by N. J. A. Sloane, Apr 07 2006

A293211 Triangle T(n,k) is the number of permutations on n elements with at least one k-cycle for 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 4, 3, 2, 15, 9, 8, 6, 76, 45, 40, 30, 24, 455, 285, 200, 180, 144, 120, 3186, 1995, 1400, 1260, 1008, 840, 720, 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040, 229384, 142695, 103040, 79380, 72576, 60480, 51840, 45360, 40320, 2293839, 1427895, 1030400, 793800, 653184, 604800, 518400, 453600, 403200, 362880
Offset: 1

Views

Author

Dennis P. Walsh, Oct 02 2017

Keywords

Comments

T(n,k) is equivalent to n! minus the number of permutations on n elements with zero k-cycles (sequence A122974).

Examples

			T(n,k) (the first 8 rows):
:     1;
:     1,     1;
:     4,     3,     2;
:    15,     9,     8,    6;
:    76,    45,    40,   30,   24;
:   455,   285,   200,  180,  144,  120;
:  3186,  1995,  1400, 1260, 1008,  840,  720;
: 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040;
  ...
T(4,3)=8 since there are exactly 8 permutations on {1,2,3,4} with at least one 3-cycle: (1)(234), (1)(243), (2)(134), (2)(143), (3)(124), (3)(142), (4)(123), and (4)(132).
		

Crossrefs

Row sums give A132961.
T(n,n) gives A000142(n-1) for n>0.
T(2n,n) gives A052145.

Programs

  • Maple
    T:=(n,k)->n!*sum((-1)^(j+1)*(1/k)^j/j!,j=1..floor(n/k)); seq(seq(T(n,k),k=1..n),n=1..10);
  • Mathematica
    Table[n!*Sum[(-1)^(j + 1)*(1/k)^j/j!, {j, Floor[n/k]}], {n, 10}, {k, n}] // Flatten (* Michael De Vlieger, Oct 02 2017 *)

Formula

T(n,k) = n! * Sum_{j=1..floor(n/k)} (-1)^(j+1)*(1/k)^j/j!.
T(n,k) = n! - A122974(n,k).
E.g.f. of column k: (1-exp(-x^k/k))/(1-x). - Alois P. Heinz, Oct 11 2017

A324564 Number T(n,k) of permutations p of [n] such that n-k is the maximum of 0 and the number of elements in any integer interval [p(i)..i+n*[i=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 4, 1, 1, 0, 15, 7, 1, 1, 0, 76, 31, 11, 1, 1, 0, 455, 185, 60, 18, 1, 1, 0, 3186, 1275, 435, 113, 29, 1, 1, 0, 25487, 10095, 3473, 1001, 215, 47, 1, 1, 0, 229384, 90109, 31315, 9289, 2299, 406, 76, 1, 1, 0, 2293839, 895169, 313227, 95747, 24610, 5320, 763, 123, 1, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2019

Keywords

Comments

Mirror image of A324563.

Examples

			Triangle T(n,k) begins:
      1;
      1,     0;
      1,     1,     0;
      4,     1,     1,     0;
     15,     7,     1,     1,      0;
     76,    31,    11,     1,      1,      0;
    455,   185,    60,    18,      1,      1,   0;
   3186,  1275,   435,   113,     29,      1,   1,  0;
  25487, 10095,  3473,  1001,    215,     47,   1,  1,  0;
  ...
Square array A(n,k) begins:
      1,     0,     0,     0,      0,      0, ...
      1,     1,     1,     1,      1,      1, ...
      1,     1,     1,     1,      1,      1, ...
      4,     7,    11,    18,     29,     47, ...
     15,    31,    60,   113,    215,    406, ...
     76,   185,   435,  1001,   2299,   5320, ...
    455,  1275,  3473,  9289,  24610,  65209, ...
   3186, 10095, 31315, 95747, 290203, 876865, ...
   ...
		

Crossrefs

Columns k=0-10 give: A002467 (for n>0), A324621, A324622, A324623, A324624, A324625, A324626, A324627, A324628, A324629, A324630.
Diagonals of the triangle (rows of the array) n=0, (1+2), 3-10 give: A000007, A000012, A000032 (for n>=3), A324631, A324632, A324633, A324634, A324635, A324636, A324637.
Row sums give A000142.
T(2n,n) or A(n,n) gives A324638.

Programs

  • Maple
    b:= proc(n, k) option remember; `if`(k>n, 0, `if`(k=0, n!,
           LinearAlgebra[Permanent](Matrix(n, (i, j)->
          `if`(j>=i and k+jk+j, 1, 0)))))
        end:
    # as triangle:
    T:= (n, k)-> b(n, k)-b(n, k+1):
    seq(seq(T(n, k), k=0..n), n=0..10);
    # as array:
    A:= (n, k)-> b(n+k, k)-b(n+k, k+1):
    seq(seq(A(d-k, k), k=0..d), d=0..10);
  • Mathematica
    b[n_, k_] := b[n, k] = If[k > n, 0, If[k == 0, n!, Permanent[Table[If[j >= i && k+j < n+i || i > k+j, 1, 0], {i, n}, {j, n}]]]];
    (* as triangle: *)
    T[n_, k_] := b[n, k] - b[n, k+1];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten
    (* as array: *)
    A[n_, k_] := b[n+k, k] - b[n+k, k+1];
    Table[A[d-k, k], {d, 0, 10}, {k, 0, d}] // Flatten (* Jean-François Alcover, May 09 2019, after Alois P. Heinz *)

A118199 Number of partitions of n having no parts equal to the size of their Durfee squares.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 18, 23, 31, 40, 53, 68, 89, 113, 146, 184, 234, 293, 369, 458, 572, 706, 874, 1073, 1320, 1611, 1970, 2393, 2909, 3518, 4255, 5122, 6167, 7394, 8862, 10585, 12637, 15038, 17886, 21213, 25141, 29723, 35112, 41383, 48737, 57278
Offset: 0

Views

Author

Emeric Deutsch, Apr 14 2006

Keywords

Comments

a(n) = A118198(n,0).
From Gus Wiseman, May 21 2022: (Start)
Also the number of integer partitions of n > 0 that have a fixed point but whose conjugate does not, ranked by A353316. For example, the a(5) = 1 through a(10) = 10 partitions are:
11111 222 322 422 522 622
111111 2221 2222 3222 4222
1111111 3221 4221 5221
22211 22221 22222
11111111 32211 32221
222111 42211
111111111 222211
322111
2221111
1111111111
Partitions w/ a fixed point: A001522 (unproved), ranked by A352827 (cf. A352874).
Partitions w/o a fixed point: A064428 (unproved), ranked by A352826 (cf. A352873).
Partitions w/ a fixed point and a conjugate fixed point: A188674, reverse A325187, ranked by A353317.
Partitions w/o a fixed point or conjugate fixed point: A188674 (shifted).
(End)

Examples

			a(7) = 3 because we have [7] with size of Durfee square 1, [4,3] with size of Durfee square 2 and [3,3,1] with size of Durfee square 2.
		

Crossrefs

Column k=0 of A118198.
A000041 counts partitions, strict A000009.
A000700 = self-conjugate partitions, ranked by A088902, complement A330644.
A002467 counts permutations with a fixed point, complement A000166.
A064410 counts partitions of crank 0, ranked by A342192.
A115720 and A115994 count partitions by Durfee square, rank stat A257990.
A238352 counts reversed partitions by fixed points, rank statistic A352822.
A238394 counts reversed partitions without a fixed point, ranked by A352830.
A238395 counts reversed partitions with a fixed point, ranked by A352872.
A352833 counts partitions by fixed points.

Programs

  • Maple
    g:=1+sum(x^(k^2+k)/(1-x^k)/product((1-x^i)^2,i=1..k-1),k=1..20): gser:=series(g,x=0,60): seq(coeff(gser,x,n),n=0..54);
    # second Maple program::
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<1, 0, b(n, i-1)+`if`(i>n, 0, b(n-i, i))))
        end:
    a:= n-> add(add(b(k, d) *b(n-d*(d+1)-k, d-1),
                    k=0..n-d*(d+1)), d=0..floor(sqrt(n))):
    seq(a(n), n=0..70);  # Alois P. Heinz, Apr 09 2012
  • Mathematica
    b[n_, i_] :=  b[n, i] = If[n == 0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i]]]]; a[n_] := Sum[Sum[b[k, d]*b[n-d*(d+1)-k, d-1], {k, 0, n-d*(d+1)}], {d, 0, Floor[Sqrt[n]]}]; Table[a[n], {n, 0, 70}] (* Jean-François Alcover, May 22 2015, after Alois P. Heinz *)
    pq[y_]:=Length[Select[Range[Length[y]],#==y[[#]]&]];
    conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]];
    Table[Length[Select[IntegerPartitions[n],pq[#]>0&&pq[conj[#]]==0&]],{n,0,30}] (* a(0) = 0, Gus Wiseman, May 21 2022 *)

Formula

G.f.: 1+sum(x^(k^2+k)/[(1-x^k)*product((1-x^i)^2, i=1..k-1)], k=1..infinity).
a(n) ~ exp(Pi*sqrt(2*n/3)) / (16*n*sqrt(3)). - Vaclav Kotesovec, Jun 12 2025

A127899 Transform related to the harmonic series.

Original entry on oeis.org

1, -2, 2, 0, -3, 3, 0, 0, -4, 4, 0, 0, 0, -5, 5, 0, 0, 0, 0, -6, 6, 0, 0, 0, 0, 0, -7, 7, 0, 0, 0, 0, 0, 0, -8, 8, 0, 0, 0, 0, 0, 0, 0, -9, 9, 0, 0, 0, 0, 0, 0, 0, 0, -10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 12
Offset: 1

Views

Author

Gary W. Adamson, Feb 04 2007

Keywords

Comments

This transform is the inverse of a triangle in which each row has n terms of the harmonic series; i.e., the inverse of: 1; 1, 1/2; 1, 1/2, 1/3; ...
Eigensequence of the unsigned triangle = A002467 starting (1, 4, 15, 76, 455, ...). - Gary W. Adamson, Dec 29 2008
Table T(n,k) read by antidiagonals. T(1,1)=1, T(n,1) = n (for n>1), T(n,2) = -n, T(n,k) = 0, k > 2. - Boris Putievskiy, Jan 17 2013

Examples

			First few rows of the triangle are:
1;
-2, 2;
0, -3, 3;
0, 0, -4, 4;
0, 0, 0, -5, 5;
0, 0, 0, 0, -6, 6;
0, 0, 0, 0, 0, -7, 7;
...
From _Boris Putievskiy_, Jan 17 2013: (Start)
The start of the sequence as table:
1..-1..0..0..0..0..0...
1..-2..0..0..0..0..0...
2..-3..0..0..0..0..0...
3..-4..0..0..0..0..0...
4..-5..0..0..0..0..0...
5..-6..0..0..0..0..0...
6..-7..0..0..0..0..0...
...
The start of the sequence as triangle array read by rows:
1;
-1,1;
0,-2,2;
0,0,-3,3;
0,0,0,-4,4;
0,0,0,0,-5,5;
0,0,0,0,0,-6,6;
0,0,0,0,0,0,-7,7;
...
Row number r (r>4) contains (r-2) times '0', then '-r' and 'r'. (End)
		

Crossrefs

Cf. A002467.

Programs

  • Haskell
    a127899 n k = a127899_tabl !! (n-1) !! (k-1)
    a127899_row n = a127899_tabl !! (n-1)
    a127899_tabl = map reverse ([1] : xss) where
       xss = iterate (\(u : v : ws) -> u + 1 : v - 1 : ws ++ [0]) [2, -2]
    -- Reinhard Zumkeller, Nov 14 2014
    
  • Maple
    A127899 := proc(n,k)
        if k = n then
            n;
        elif k = n-1 then
            -n;
        else
            0;
        end if;
    end proc:
    seq(seq( A127899(n,k),k=1..n),n=1..13) ; # R. J. Mathar, Jul 19 2024
  • Mathematica
    Table[Module[{t = Floor[(-1 + Sqrt[8 n - 7])/2], i}, i = n - t (t + 1)/2; Floor[(i + 2)/(t + 2)] (t + 1) (-1)^(i + t + 1)], {n, 78}] (* or *)
    Table[If[n == 1, {n}, ConstantArray[0, n - 2]~Join~{-n, n}], {n, 12}] // Flatten (* Michael De Vlieger, Feb 11 2017 *)
  • Python
    from math import isqrt
    def A127899(n): return -(isqrt(n<<3)+1>>1)**2+(m:=isqrt(n+1<<3)+1>>1)*((m<<1)-1)+(k:=isqrt(n+2<<3)+1>>1)*(1-k)>>1 # Chai Wah Wu, Jun 08 2025

Formula

Triangle, a(1) = 1; by rows, (n-2) zeros followed by -n, n.
From Boris Putievskiy, Jan 17 2013: (Start)
a(n) = floor((A002260(n)+2)/(A003056(n)+2))*(A003056(n)+1)*(-1)^(A002260(n)+A003056(n)+1), n>0.
a(n) = floor((i+2)/(t+2))*(t+1)*(-1)^(i+t+1), where i=n-t*(t+1)/2, t=floor((-1+sqrt(8*n-7))/2). (End)
a(n) = floor(-1/2*A002024(n)^2 + A002024(n+1)^2-1/2*A002024(n+1) + 1/2*A002024(n+2) - 1/2*A002024(n+2)^2). - Brian Tenneson, Feb 10 2017

A232744 Numbers k for which the largest m such that m! divides k is odd.

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 25, 27, 29, 30, 31, 33, 35, 36, 37, 39, 41, 42, 43, 45, 47, 49, 51, 53, 54, 55, 57, 59, 60, 61, 63, 65, 66, 67, 69, 71, 73, 75, 77, 78, 79, 81, 83, 84, 85, 87, 89, 90, 91, 93, 95, 97, 99, 101, 102, 103, 105
Offset: 1

Views

Author

Antti Karttunen, Dec 01 2013

Keywords

Comments

Numbers k for which A055881(k) is odd.
Equally: Numbers k which have an even number of the trailing zeros in their factorial base representation A007623(k).
The sequence can be described in the following manner: Sequence includes all multiples of 1!, except that it excludes from those the multiples of 2!, except that it includes the multiples of 3! (6), except that it excludes the multiples of 4! (24), except that it includes the multiples of 5! (120), except that it excludes the multiples of 6! (720), except that it includes the multiples of 7! (5040), except that it excludes the multiples of 8! (40320), except that it includes the multiples of 9! (362880), and so on, ad infinitum.
The number of terms not exceeding m! for m>=1 is A002467(m). The asymptotic density of this sequence is 1 - 1/e (A068996). - Amiram Eldar, Feb 26 2021

Crossrefs

Complement: A232745. Cf. also A055881, A007623, A232741-A232743.
Analogous sequences for binary system: A003159 & A036554.

Programs

  • Mathematica
    seq[max_] := Select[Range[max!], EvenQ @ LengthWhile[Reverse @ IntegerDigits[#, MixedRadix[Range[max, 2, -1]]], #1 == 0 &] &]; seq[5] (* Amiram Eldar, Feb 26 2021 *)

Formula

a(1)=1, and for n>1, a(n) = a(n-1) + (2 - A000035(A055881(a(n-1)+1))).

A055596 Expansion of e.g.f. (2 - x - 2*exp(-x))/(1-x).

Original entry on oeis.org

1, 0, 2, 6, 32, 190, 1332, 10654, 95888, 958878, 10547660, 126571918, 1645434936, 23036089102, 345541336532, 5528661384510, 93987243536672, 1691770383660094, 32143637289541788, 642872745790835758, 13500327661607550920, 297007208555366120238
Offset: 1

Views

Author

Gary Detlefs, Jul 10 2000

Keywords

Comments

It appears that a(n) = n*a(n-1) + 2(-1)^(n+1) and that the n-th term of any sequence of the form {A(0) =a, A(1)= b, A(n) = (n-1)(A(n-1)+A(n-2))} is A(n) = b*A000166(n) + a*A055596(n). A(n) can also be expressed as A(n) = n*A(n-1) + (2a-b)(-1)^(n+1). - Gary Detlefs, Jun 13 2009
For n>1, sum over all permutations beginning with an ascent, ending with a descent, and without double ascents on n elements and each contributes 2 to the power of the number of double descents. By symmetry, also the sum over all permutations with a descent, ending with an ascent, and no double ascents and the sum is (again) over 2 to the power of the number of double descents. - Richard Ehrenborg, Oct 08 2013
It also appears related to a Secret Santa problem: given n people getting names from an urn to give presents and putting them back in the urn if they get their own name, this seems to be the number of ways that it may fail for the last person, as he/she has no other name to get from the urn. - João Batista Souza de Oliveira, Jan 25 2016

Examples

			a(4)=6 since the 3 permutations 1432, 2431, 3421 all have one double descent and hence each contributes 2 to the sum. - _Richard Ehrenborg_, Oct 08 2013
For the Secret Santa, a(3)=2 since person 1 will get the names of either person 2 or 3. Suppose it was person 2. Person 2 will then get either person 1 or person 3. If he/she gets person 1, the draw will fail for person 3. The other case occurs when person 1 draws person 3, person 3 draws person 1 and the draw fails for person 2. - _João Batista Souza de Oliveira_, Jan 25 2016
		

Crossrefs

Programs

  • Magma
    A055596:= func< n | Factorial(n)*(1 -2*(&+[(-1)^j/Factorial(j): j in [0..n]]) ) >;
    [A055596(n): n in [1..30]]; // G. C. Greubel, Sep 06 2022
    
  • Mathematica
    Rest[CoefficientList[Series[(2-x-2*E^(-x))/(1-x), {x, 0, 20}], x]* Range[0, 20]!] (* Vaclav Kotesovec, Oct 07 2013 *)
  • PARI
    a(n)=if(n<2, n>0, n*a(n-1)-2*(-1)^n)
    
  • PARI
    a(n)=if(n<1,0,n!*polcoeff((2-x-2*exp(-x+x*O(x^n)))/(1-x),n))
    
  • SageMath
    def A055596(n): return factorial(n)*( 2*bool(n==0) + 1 - 2*sum((-1)^j/factorial(j) for j in (0..n)) )
    [A055596(n) for n in (1..30)] # G. C. Greubel, Sep 06 2022

Formula

E.g.f.: (2-x-2*exp(-x))/(1-x).
a(n) = (n-1)*(a(n-1) + a(n-2)) = 2*A006347(n-1), n>2.
a(n) = n! - 2*A000166(n), n>0.
a(n) ~ n! * (1-2*exp(-1)). - Vaclav Kotesovec, Oct 07 2013
For n>2, a(n) = floor(n! * (1-2*exp(-1)) + 1/2). - Peter Bala, Oct 08 2013
a(n+1) = 2*A002467(n) - n!. - Vaclav Kotesovec, Oct 08 2013

Extensions

More terms from James Sellers, Jul 11 2000

A002468 The game of Mousetrap with n cards: the number of permutations of n cards having at least one hit after 2.

Original entry on oeis.org

0, 0, 1, 3, 13, 65, 397, 2819, 22831, 207605, 2094121, 23205383, 280224451, 3662810249, 51523391965, 776082247979, 12463259986087, 212573743211549, 3837628837381201, 73108996989052175, 1465703611456618891, 30847249002794047793, 679998362512214208901, 15668677914172813691699, 376683592679293811722735
Offset: 1

Views

Author

Keywords

Comments

The subsequence of primes begins: 3, 13, 397, 2819, no more through a(19). - Jonathan Vos Post, Feb 01 2011

References

  • R. K. Guy and R. J. Nowakowski, "Mousetrap," in D. Miklos, V. T. Sos and T. Szonyi, eds., Combinatorics, Paul Erdős is Eighty. Bolyai Society Math. Studies, Vol. 1, pp. 193-206, 1993.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[n_] := (n-2)*(n-2)!-(n-4)*Subfactorial[n-3]-(n-3)*Subfactorial[n-2]; a[1]=a[2]=0; a[3]=1; Table[a[n], {n, 1, 21}] (* Jean-François Alcover, Dec 12 2014 *)

Formula

a(n) = A001563(n) - A002469(n+2). (corrected by Sean A. Irvine and Joerg Arndt, Feb 10 2014)

Extensions

Added two more terms, Joerg Arndt, Feb 15 2014

A002469 The game of Mousetrap with n cards: the number of permutations of n cards in which 2 is the only hit.

Original entry on oeis.org

0, 0, 1, 5, 31, 203, 1501, 12449, 114955, 1171799, 13082617, 158860349, 2085208951, 29427878435, 444413828821, 7151855533913, 122190894996451, 2209057440250799, 42133729714051825, 845553296311189109, 17810791160738752207, 392911423093684031099
Offset: 2

Views

Author

Keywords

Examples

			G.f.: x^4 + 5*x^5 + 31*x^6 + 203*x^7 + 1501*x^8 + 12449*x^9 + 114955*x^10 + ...
		

References

  • R. K. Guy, Unsolved Problems Number Theory, E37.
  • R. K. Guy and R. J. Nowakowski, "Mousetrap," in D. Miklos, V. T. Sos and T. Szonyi, eds., Combinatorics, Paul Erdős is Eighty. Bolyai Society Math. Studies, Vol. 1, pp. 193-206, 1993.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    A002469:=n->(n-3)*floor(((n-2)!+1)/exp(1)) + (n-4)*floor(((n-3)!+1)/exp(1)): 0, seq(A002469(n), n=3..30); # Wesley Ivan Hurt, Jan 10 2017
  • Mathematica
    Join[{0},Table[(n-3)Floor[((n-2)!+1)/E]+(n-4)Floor[((n-3)!+1)/E], {n,3,30}]] (* Harvey P. Dale, Feb 05 2012 *)
    a[n_] := (n-3)*Subfactorial[n-2]+(n-4)*Subfactorial[n-3]; a[n_ /; n <= 3] = 0; Table[a[n], {n, 2, 23}] (* Jean-François Alcover, Dec 12 2014 *)
  • PARI
    default(realprecision,200);
    e=exp(1);
    A002469(n) = if( n<=3, 0, (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e) );
    /* Joerg Arndt, Apr 22 2013 */

Formula

a(n) = sum of terms in (n-2)-nd row of triangle A159610; equivalent to: a(n) = (n-2)*A000255(n-1) + A000166(n). - Gary W. Adamson, Apr 17 2009
a(n) = (n-3)* A000166(n-2) + (n-4)* A000166(n-3). - Gary Detlefs, Apr 10 2010
a(n) = (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e), for n>2. - Gary Detlefs, Apr 10 2010
G.f.: x - 1 + (1-2*x)/(x*Q(0)), where Q(k) = 1/x - (2*k+1) - (k+1)*(k+2)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Apr 25 2013

Extensions

More terms from Harvey P. Dale, Feb 05 2012

A248925 Triangle in which row n consists of the coefficients in Sum_{m=0..n} x^m * Product_{k=m+1..n} (1-k*x), as read by rows.

Original entry on oeis.org

1, 1, 0, 1, -2, 1, 1, -5, 7, -2, 1, -9, 27, -30, 9, 1, -14, 72, -165, 159, -44, 1, -20, 156, -597, 1149, -998, 265, 1, -27, 296, -1689, 5328, -9041, 7251, -1854, 1, -35, 512, -4057, 18840, -51665, 79579, -59862, 14833, 1, -44, 827, -8665, 55353, -221225, 544564, -776073, 553591, -133496
Offset: 0

Views

Author

Paul D. Hanna, Oct 16 2014

Keywords

Comments

If m=n, we have Sum_{k=0..n} A008277(n, k) = A000110(n) = Sum_{j=0..n} T(n,j)*A008277(2n-j,n) where A000110(n) is the n-th Bell number. - Robert A. Russell, Apr 08 2018

Examples

			Triangle begins:
1;
1, 0;
1, -2, 1;
1, -5, 7, -2;
1, -9, 27, -30, 9;
1, -14, 72, -165, 159, -44;
1, -20, 156, -597, 1149, -998, 265;
1, -27, 296, -1689, 5328, -9041, 7251, -1854;
1, -35, 512, -4057, 18840, -51665, 79579, -59862, 14833;
1, -44, 827, -8665, 55353, -221225, 544564, -776073, 553591, -133496;
1, -54, 1267, -16935, 142003, -774755, 2756814, -6221713, 8314321, -5669406, 1334961; ...
Generating method for row n:
n=0: 1 = 1;
n=1: 1 + 0*x = (1-x) * ( 1 + x/(1-x) );
n=2: 1 - 2*x + x^2 = (1-x)*(1-2*x) * ( 1 + x/(1-x) + x^2/((1-x)*(1-2*x)) );
n=3: 1 - 5*x + 7*x^2 - 2*x^3 = (1-x)*(1-2*x)*(1-3*x) * ( 1 + x/(1-x) + x^2/((1-x)*(1-2*x)) + x^3/((1-x)*(1-2*x)*(1-3*x)) );
n=4: 1 - 9*x + 27*x^2 - 30*x^3 + 9*x^4 = (1-x)*(1-2*x)*(1-3*x)*(1-4*x) * ( 1 + x/(1-x) + x^2/((1-x)*(1-2*x)) + x^3/((1-x)*(1-2*x)*(1-3*x)) + x^4/((1-x)*(1-2*x)*(1-3*x)*(1-4*x)) ); ...
Compare the row g.f.s to the o.g.f. of Bell numbers (A000110):
B(x) = 1 + x/(1-x) + x^2/((1-x)*(1-2*x)) + x^3/((1-x)*(1-2*x)*(1-3*x)) + x^4/((1-x)*(1-2*x)*(1-3*x)*(1-4*x)) +...
Central terms of triangle begin:
[1, -2, 27, -597, 18840, -774755, 39320575, -2375828028, 166592007731, -13300276081039, 1191315248017730, ...].
		

Crossrefs

Programs

  • Mathematica
    Table[LinearSolve[Table[StirlingS2[m+j, n], {m, 0, n}, {j, n, 0, -1}],
      Table[Sum[StirlingS2[m, j], {j, 0, n}], {m, 0, n}]], {n, 0, 20}]
      // Flatten (* Robert A. Russell, Mar 30 2018 *)
    Table[PadRight[CoefficientList[Sum[x^m*Product[1-j*x, {j, m+1, n}],
      {m, 0, n}], x], n+1], {n, 0, 20}] // Flatten (* Robert A. Russell, Apr 08 2018 *)
    T[n_, 0] := T[n,0] = 1;
    T[n_, k_] := T[n,k] = If[kRobert A. Russell, Apr 25 2018 *)
  • PARI
    {T(n,k)=polcoeff(sum(m=0,n, x^m*prod(j=m+1,n,1-j*x)), k)}
    for(n=0,10,for(k=0,n,print1(T(n,k),", "));print(""))

Formula

Right border equals A000166, the subfactorial numbers.
Row sums equal A000166 (shift right 1 place).
Row sums of unsigned terms yields A002467(n) = n! - A000166(n).
Sum_{k=0..n} A008277(m, k) = Sum_{j=0..n} T(n, j)*A008277(m+n-j, n) where A008277(m, k) are Stirling subset numbers. - Robert A. Russell, Mar 30 2018
T(n,0) = 1.
For k>0, T(n,k) = [k==n] + [kRobert A. Russell, Apr 25 2018
Previous Showing 21-30 of 73 results. Next