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

A000166 Subfactorial or rencontres numbers, or derangements: number of permutations of n elements with no fixed points.

Original entry on oeis.org

1, 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, 1334961, 14684570, 176214841, 2290792932, 32071101049, 481066515734, 7697064251745, 130850092279664, 2355301661033953, 44750731559645106, 895014631192902121, 18795307255050944540, 413496759611120779881, 9510425471055777937262
Offset: 0

Views

Author

Keywords

Comments

Euler (1809) not only gives the first ten or so terms of the sequence, he also proves both recurrences a(n) = (n-1)*(a(n-1) + a(n-2)) and a(n) = n*a(n-1) + (-1)^n.
a(n) is the permanent of the matrix with 0 on the diagonal and 1 elsewhere. - Yuval Dekel, Nov 01 2003
a(n) is the number of desarrangements of length n. A desarrangement of length n is a permutation p of {1,2,...,n} for which the smallest of all the ascents of p (taken to be n if there are no ascents) is even. Example: a(3) = 2 because we have 213 and 312 (smallest ascents at i = 2). See the J. Désarménien link and the Bona reference (p. 118). - Emeric Deutsch, Dec 28 2007
a(n) is the number of deco polyominoes of height n and having in the last column an even number of cells. A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column. - Emeric Deutsch, Dec 28 2007
Attributed to Nicholas Bernoulli in connection with a probability problem that he presented. See Problem #15, p. 494, in "History of Mathematics" by David M. Burton, 6th edition. - Mohammad K. Azarian, Feb 25 2008
a(n) is the number of permutations p of {1,2,...,n} with p(1)!=1 and having no right-to-left minima in consecutive positions. Example a(3) = 2 because we have 231 and 321. - Emeric Deutsch, Mar 12 2008
a(n) is the number of permutations p of {1,2,...,n} with p(n)! = n and having no left to right maxima in consecutive positions. Example a(3) = 2 because we have 312 and 321. - Emeric Deutsch, Mar 12 2008
Number of wedged (n-1)-spheres in the homotopy type of the Boolean complex of the complete graph K_n. - Bridget Tenner, Jun 04 2008
The only prime number in the sequence is 2. - Howard Berman (howard_berman(AT)hotmail.com), Nov 08 2008
From Emeric Deutsch, Apr 02 2009: (Start)
a(n) is the number of permutations of {1,2,...,n} having exactly one small ascent. A small ascent in a permutation (p_1,p_2,...,p_n) is a position i such that p_{i+1} - p_i = 1. (Example: a(3) = 2 because we have 312 and 231; see the Charalambides reference, pp. 176-180.) [See also David, Kendall and Barton, p. 263. - N. J. A. Sloane, Apr 11 2014]
a(n) is the number of permutations of {1,2,...,n} having exactly one small descent. A small descent in a permutation (p_1,p_2,...,p_n) is a position i such that p_i - p_{i+1} = 1. (Example: a(3)=2 because we have 132 and 213.) (End)
For n > 2, a(n) + a(n-1) = A000255(n-1); where A000255 = (1, 1, 3, 11, 53, ...). - Gary W. Adamson, Apr 16 2009
Connection to A002469 (game of mousetrap with n cards): A002469(n) = (n-2)*A000255(n-1) + A000166(n). (Cf. triangle A159610.) - Gary W. Adamson, Apr 17 2009
From Emeric Deutsch, Jul 18 2009: (Start)
a(n) is the sum of the values of the largest fixed points of all non-derangements of length n-1. Example: a(4)=9 because the non-derangements of length 3 are 123, 132, 213, and 321, having largest fixed points 3, 1, 3, and 2, respectively.
a(n) is the number of non-derangements of length n+1 for which the difference between the largest and smallest fixed point is 2. Example: a(3) = 2 because we have 1'43'2 and 32'14'; a(4) = 9 because we have 1'23'54, 1'43'52, 1'53'24, 52'34'1, 52'14'3, 32'54'1, 213'45', 243'15', and 413'25' (the extreme fixed points are marked).
(End)
a(n), n >= 1, is also the number of unordered necklaces with n beads, labeled differently from 1 to n, where each necklace has >= 2 beads. This produces the M2 multinomial formula involving partitions without part 1 given below. Because M2(p) counts the permutations with cycle structure given by partition p, this formula gives the number of permutations without fixed points (no 1-cycles), i.e., the derangements, hence the subfactorials with their recurrence relation and inputs. Each necklace with no beads is assumed to contribute a factor 1 in the counting, hence a(0)=1. This comment derives from a family of recurrences found by Malin Sjodahl for a combinatorial problem for certain quark and gluon diagrams (Feb 27 2010). - Wolfdieter Lang, Jun 01 2010
From Emeric Deutsch, Sep 06 2010: (Start)
a(n) is the number of permutations of {1,2,...,n, n+1} starting with 1 and having no successions. A succession in a permutation (p_1,p_2,...,p_n) is a position i such that p_{i+1} - p_i = 1. Example: a(3)=2 because we have 1324 and 1432.
a(n) is the number of permutations of {1,2,...,n} that do not start with 1 and have no successions. A succession in a permutation (p_1,p_2,...,p_n) is a position i such that p_{i+1} - p_i = 1. Example: a(3)=2 because we have 213 and 321.
(End)
Increasing colored 1-2 trees with choice of two colors for the rightmost branch of nonleave except on the leftmost path, there is no vertex of outdegree one on the leftmost path. - Wenjin Woan, May 23 2011
a(n) is the number of zeros in n-th row of the triangle in A170942, n > 0. - Reinhard Zumkeller, Mar 29 2012
a(n) is the maximal number of totally mixed Nash equilibria in games of n players, each with 2 pure options. - Raimundas Vidunas, Jan 22 2014
Convolution of sequence A135799 with the sequence generated by 1+x^2/(2*x+1). - Thomas Baruchel, Jan 08 2016
The number of interior lattice points of the subpolytope of the n-dimensional permutohedron whose vertices correspond to permutations avoiding 132 and 312. - Robert Davis, Oct 05 2016
Consider n circles of different radii, where each circle is either put inside some bigger circle or contains a smaller circle inside it (no common points are allowed). Then a(n) gives the number of such combinations. - Anton Zakharov, Oct 12 2016
If we partition the permutations of [n+1] in A000240 according to their starting digit, we will get (n+1) equinumerous classes each of size a(n), i.e., A000240(n+1) = (n+1)*a(n), hence a(n) is the size of each class of permutations of [n+1] in A000240. For example, for n = 4 we have 45 = 5*9. - Enrique Navarrete, Jan 10 2017
Call d_n1 the permutations of [n] that have the substring n1 but no substring in {12,23,...,(n-1)n}. If we partition them according to their starting digit, we will get (n-1) equinumerous classes each of size A000166(n-2) (the class starting with the digit 1 is empty since we must have the substring n1). Hence d_n1 = (n-1)*A000166(n-2) and A000166(n-2) is the size of each nonempty class in d_n1. For example, d_71 = 6*44 = 264, so there are 264 permutations in d_71 distributed in 6 nonempty classes of size A000166(5) = 44. (To get permutations in d_n1 recursively from more basic ones see the link "Forbidden Patterns" below.) - Enrique Navarrete, Jan 15 2017
Also the number of maximum matchings and minimum edge covers in the n-crown graph. - Eric W. Weisstein, Jun 14 and Dec 24 2017
The sequence a(n) taken modulo a positive integer k is periodic with exact period dividing k when k is even and dividing 2*k when k is odd. This follows from the congruence a(n+k) = (-1)^k*a(n) (mod k) for all n and k, which in turn is easily proved by induction making use of the recurrence a(n) = n*a(n-1) + (-1)^n. - Peter Bala, Nov 21 2017
a(n) is the number of distinct possible solutions for a directed, no self loop containing graph (not necessarily connected) that has n vertices, and each vertex has an in- and out-degree of exactly 1. - Patrik Holopainen, Sep 18 2018
a(n) is the dimension of the kernel of the random-to-top and random-to-random shuffling operators over a collection of n objects (in a vector space of size n!), as noticed by M. Wachs and V. Reiner. See the Reiner, Saliola and Welker reference below. - Nadia Lafreniere, Jul 18 2019
a(n) is the number of distinct permutations for a Secret Santa gift exchange with n participants. - Patrik Holopainen, Dec 30 2019
a(2*n+1) is even. More generally, a(m*n+1) is divisible by m*n, which follows from a(n+1) = n*(a(n) + a(n-1)) = n*A000255(n-1) for n >= 1. a(2*n) is odd; in fact, a(2*n) == 1 (mod 8). Other divisibility properties include a(6*n) == 1 (mod 24), a(9*n+4) == a(9*n+7) == 0 (mod 9), a(10*n) == 1 (mod 40), a(11*n+5) == 0 (mod 11) and a(13*n+8 ) == 0 (mod 13). - Peter Bala, Apr 05 2022
Conjecture: a(n) with n > 2 is a perfect power only for n = 4 with a(4) = 3^2. This has been verified for n <= 1000. - Zhi-Wei Sun, Jan 09 2025

Examples

			a(2) = 1, a(3) = 2 and a(4) = 9 since the possibilities are {BA}, {BCA, CAB} and {BADC, BCDA, BDAC, CADB, CDAB, CDBA, DABC, DCAB, DCBA}. - _Henry Bottomley_, Jan 17 2001
The Boolean complex of the complete graph K_4 is homotopy equivalent to the wedge of 9 3-spheres.
Necklace problem for n = 6: partitions without part 1 and M2 numbers for n = 6: there are A002865(6) = 4 such partitions, namely (6), (2,4), (3^2) and (2^3) in A-St order with the M2 numbers 5!, 90, 40 and 15, respectively, adding up to 265 = a(6). This corresponds to 1 necklace with 6 beads, two necklaces with 2 and 4 beads respectively, two necklaces with 3 beads each and three necklaces with 2 beads each. - _Wolfdieter Lang_, Jun 01 2010
G.f. = 1 + x^2 + 9*x^3 + 44*x^4 + 265*x^5 + 1854*x^6 + 14833*x^7 + 133496*x^8 + ...
		

References

  • U. Abel, Some new identities for derangement numbers, Fib. Q., 56:4 (2018), 313-318.
  • M. Bona, Combinatorics of Permutations, Chapman & Hall/CRC, Boca Raton, Florida, 2004.
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 32.
  • R. A. Brualdi and H. J. Ryser: Combinatorial Matrix Theory, 1992, Section 7.2, p. 202.
  • Ch. A. Charalambides, Enumerative Combinatorics, Chapman & Hall/CRC, Boca Raton, Florida, 2002.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 182.
  • Florence Nightingale David and D. E. Barton, Combinatorial Chance. Hafner, NY, 1962, p. 168.
  • Florence Nightingale David, Maurice George Kendall, and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263, Table 7.5.1, row 1.
  • P. R. de Montmort, On the Game of Thirteen (1713), reprinted in Annotated Readings in the History of Statistics, ed. H. A. David and A. W. F. Edwards, Springer-Verlag, 2001, pp. 25-29.
  • J. M. de Saint-Martin, "Le problème des rencontres" in Quadrature, No. 61, pp. 14-19, 2006, EDP-Sciences Les Ulis (France).
  • H. Doerrie, 100 Great Problems of Elementary Mathematics, Dover, NY, 1965, p. 19.
  • Leonhard Euler, Solution quaestionis curiosae ex doctrina combinationum, Mémoires Académie sciences St. Pétersburg 3 (1809/1810), 57-64; also E738 in his Collected Works, series I, volume 7, pages 435-440.
  • J. M. Gandhi, On logarithmic numbers, Math. Student, 31 (1963), 73-83.
  • A. Hald, A History of Probability and Statistics and Their Applications Before 1750, Wiley, NY, 1990 (Chapter 19).
  • Irving Kaplansky, John Riordan, The problème des ménages. Scripta Math. 12 (1946), 113-124. See Eq(1).
  • Arnold Kaufmann, "Introduction à la combinatorique en vue des applications." Dunod, Paris, 1968. See p. 92.
  • Florian Kerschbaum and Orestis Terzidis, Filtering for Private Collaborative Benchmarking, in Emerging Trends in Information and Communication Security, Lecture Notes in Computer Science, Volume 3995/2006.
  • E. Lozansky and C. Rousseau, Winning Solutions, Springer, 1996; see p. 152.
  • P. A. MacMahon, Combinatory Analysis, 2 vols., Chelsea, NY, 1960, see p. 102.
  • M. S. Petković, "Non-attacking rooks", Famous Puzzles of Great Mathematicians, pp. 265-268, Amer. Math. Soc.(AMS), 2009.
  • V. Reiner, F. Saliola, and V. Welker. Spectra of Symmetrized Shuffling Operators, Memoirs of the American Mathematical Society, vol. 228, Amer. Math. Soc., Providence, RI, 2014, pp. 1-121. See section VI.9.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 65.
  • H. J. Ryser, Combinatorial Mathematics. Mathematical Association of America, Carus Mathematical Monograph 14, 1963, p. 23.
  • T. Simpson, Permutations with unique fixed and reflected points. Ars Combin. 39 (1995), 97-108.
  • 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).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 122.
  • D. B. West, Combinatorial Mathematics, Cambridge, 2021, p. 82.
  • H. S. Wilf, Generatingfunctionology, Academic Press, NY, 1990, p. 147, Eq. 5.2.9 (q=1).

Crossrefs

For the probabilities a(n)/n!, see A053557/A053556 and A103816/A053556.
A diagonal of A008291 and A068106. Column A008290(n,0).
A001120 has a similar recurrence.
For other derangement numbers see also A053871, A033030, A088991, A088992.
Pairwise sums of A002741 and A000757. Differences of A001277.
A diagonal in triangles A008305 and A010027.
a(n)/n! = A053557/A053556 = (N(n, n) of A103361)/(D(n, n) of A103360).
Column k=0 of A086764 and of A334715. Column k=1 of A364068.
Row sums of A216963 and of A323671.

Programs

  • Haskell
    a000166 n = a000166_list !! n
    a000166_list = 1 : 0 : zipWith (*) [1..]
                           (zipWith (+) a000166_list $ tail a000166_list)
    -- Reinhard Zumkeller, Dec 09 2012
    
  • Magma
    I:=[0,1]; [1] cat [n le 2 select I[n] else (n-1)*(Self(n-1)+Self(n-2)): n in [1..30]]; // Vincenzo Librandi, Jan 07 2016
  • Maple
    A000166 := proc(n) option remember; if n<=1 then 1-n else (n-1)*(procname(n-1)+procname(n-2)); fi; end;
    a:=n->n!*sum((-1)^k/k!, k=0..n): seq(a(n), n=0..21); # Zerinvary Lajos, May 17 2007
    ZL1:=[S,{S=Set(Cycle(Z,card>1))},labeled]: seq(count(ZL1,size=n),n=0..21); # Zerinvary Lajos, Sep 26 2007
    with (combstruct):a:=proc(m) [ZL,{ZL=Set(Cycle(Z,card>=m))},labeled]; end: A000166:=a(2):seq(count(A000166,size=n),n=0..21); # Zerinvary Lajos, Oct 02 2007
    Z := (x, m)->m!^2*sum(x^j/((m-j)!^2), j=0..m): R := (x, n, m)->Z(x, m)^n: f := (t, n, m)->sum(coeff(R(x, n, m), x, j)*(t-1)^j*(n*m-j)!, j=0..n*m): seq(f(0, n, 1), n=0..21); # Zerinvary Lajos, Jan 22 2008
    a:=proc(n) if `mod`(n,2)=1 then sum(2*k*factorial(n)/factorial(2*k+1), k=1.. floor((1/2)*n)) else 1+sum(2*k*factorial(n)/factorial(2*k+1), k=1..floor((1/2)*n)-1) end if end proc: seq(a(n),n=0..20); # Emeric Deutsch, Feb 23 2008
    G(x):=2*exp(-x)/(1-x): f[0]:=G(x): for n from 1 to 26 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n]/2,n=0..21); # Zerinvary Lajos, Apr 03 2009
    seq(simplify(KummerU(-n, -n, -1)), n = 0..23); # Peter Luschny, May 10 2022
  • Mathematica
    a[0] = 1; a[n_] := n*a[n - 1] + (-1)^n; a /@ Range[0, 21] (* Robert G. Wilson v *)
    a[0] = 1; a[1] = 0; a[n_] := Round[n!/E] /; n >= 1 (* Michael Taktikos, May 26 2006 *)
    Range[0, 20]! CoefficientList[ Series[ Exp[ -x]/(1 - x), {x, 0, 20}], x]
    dr[{n_,a1_,a2_}]:={n+1,a2,n(a1+a2)}; Transpose[NestList[dr,{0,0,1},30]][[3]] (* Harvey P. Dale, Feb 23 2013 *)
    a[n_] := (-1)^n HypergeometricPFQ[{- n, 1}, {}, 1]; (* Michael Somos, Jun 01 2013 *)
    a[n_] := n! SeriesCoefficient[Exp[-x] /(1 - x), {x, 0, n}]; (* Michael Somos, Jun 01 2013 *)
    Table[Subfactorial[n], {n, 0, 21}] (* Jean-François Alcover, Jan 10 2014 *)
    RecurrenceTable[{a[n] == n*a[n - 1] + (-1)^n, a[0] == 1}, a, {n, 0, 23}] (* Ray Chandler, Jul 30 2015 *)
    Subfactorial[Range[0, 20]] (* Eric W. Weisstein, Dec 31 2017 *)
    nxt[{n_,a_}]:={n+1,a(n+1)+(-1)^(n+1)}; NestList[nxt,{0,1},25][[All,2]] (* Harvey P. Dale, Jun 01 2019 *)
  • Maxima
    s[0]:1$
    s[n]:=n*s[n-1]+(-1)^n$
    makelist(s[n],n,0,12); /* Emanuele Munarini, Mar 01 2011 */
    
  • PARI
    {a(n) = if( n<1, 1, n * a(n-1) + (-1)^n)}; /* Michael Somos, Mar 24 2003 */
    
  • PARI
    {a(n) = n! * polcoeff( exp(-x + x * O(x^n)) / (1 - x), n)}; /* Michael Somos, Mar 24 2003 */
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,m^m*x^m/(1+(m+1)*x+x*O(x^n))^(m+1)),n)} /* Paul D. Hanna */
    
  • PARI
    A000166=n->n!*sum(k=0,n,(-1)^k/k!) \\ M. F. Hasler, Jan 26 2012
    
  • PARI
    a(n)=if(n,round(n!/exp(1)),1) \\ Charles R Greathouse IV, Jun 17 2012
    
  • PARI
    apply( {A000166(n)=n!\/exp(n>0)}, [0..22]) \\ M. F. Hasler, Nov 09 2024
    
  • Python
    See Hobson link.
    
  • Python
    A000166_list, m, x = [], 1, 1
    for n in range(10*2):
        x, m = x*n + m, -m
        A000166_list.append(x) # Chai Wah Wu, Nov 03 2014
    

Formula

a(n) = A008290(n,0).
a(n) + A003048(n+1) = 2*n!. - D. G. Rogers, Aug 26 2006
a(n) = {(n-1)!/exp(1)}, n > 1, where {x} is the nearest integer function. - Simon Plouffe, March 1993 [This uses offset 1, see below for the version with offset 0. - Charles R Greathouse IV, Jan 25 2012]
a(0) = 1, a(n) = round(n!/e) = floor(n!/e + 1/2) for n > 0.
a(n) = n!*Sum_{k=0..n} (-1)^k/k!.
D-finite with recurrence a(n) = (n-1)*(a(n-1) + a(n-2)), n > 0.
a(n) = n*a(n-1) + (-1)^n.
E.g.f.: exp(-x)/(1-x).
a(n) = Sum_{k=0..n} binomial(n, k)*(-1)^(n-k)*k! = Sum_{k=0..n} (-1)^(n-k)*n!/(n-k)!. - Paul Barry, Aug 26 2004
The e.g.f. y(x) satisfies y' = x*y/(1-x).
Inverse binomial transform of A000142. - Ross La Haye, Sep 21 2004
In Maple notation, representation as n-th moment of a positive function on [-1, infinity]: a(n)= int( x^n*exp(-x-1), x=-1..infinity ), n=0, 1... . a(n) is the Hamburger moment of the function exp(-1-x)*Heaviside(x+1). - Karol A. Penson, Jan 21 2005
a(n) = A001120(n) - n!. - Philippe Deléham, Sep 04 2005
a(n) = Integral_{x=0..oo} (x-1)^n*exp(-x) dx. - Gerald McGarvey, Oct 14 2006
a(n) = Sum_{k=2,4,...} T(n,k), where T(n,k) = A092582(n,k) = k*n!/(k+1)! for 1 <= k < n and T(n,n)=1. - Emeric Deutsch, Feb 23 2008
a(n) = n!/e + (-1)^n*(1/(n+2 - 1/(n+3 - 2/(n+4 - 3/(n+5 - ...))))). Asymptotic result (Ramanujan): (-1)^n*(a(n) - n!/e) ~ 1/n - 2/n^2 + 5/n^3 - 15/n^4 + ..., where the sequence [1,2,5,15,...] is the sequence of Bell numbers A000110. - Peter Bala, Jul 14 2008
From William Vaughn (wvaughn(AT)cvs.rochester.edu), Apr 13 2009: (Start)
a(n) = Integral_{p=0..1} (log(1/(1-p)) - 1)^n dp.
Proof: Using the substitutions 1=log(e) and y = e(1-p) the above integral can be converted to ((-1)^n/e) Integral_{y=0..e} (log(y))^n dy.
From CRC Integral tables we find the antiderivative of (log(y))^n is (-1)^n n! Sum_{k=0..n} (-1)^k y(log(y))^k / k!.
Using the fact that e(log(e))^r = e for any r >= 0 and 0(log(0))^r = 0 for any r >= 0 the integral becomes n! * Sum_{k=0..n} (-1)^k / k!, which is line 9 of the Formula section. (End)
a(n) = exp(-1)*Gamma(n+1,-1) (incomplete Gamma function). - Mark van Hoeij, Nov 11 2009
G.f.: 1/(1-x^2/(1-2x-4x^2/(1-4x-9x^2/(1-6x-16x^2/(1-8x-25x^2/(1-... (continued fraction). - Paul Barry, Nov 27 2009
a(n) = Sum_{p in Pano1(n)} M2(p), n >= 1, with Pano1(n) the set of partitions without part 1, and the multinomial M2 numbers. See the characteristic array for partitions without part 1 given by A145573 in Abramowitz-Stegun (A-S) order, with A002865(n) the total number of such partitions. The M2 numbers are given for each partition in A-St order by the array A036039. - Wolfdieter Lang, Jun 01 2010
a(n) = row sum of A008306(n), n > 1. - Gary Detlefs, Jul 14 2010
a(n) = ((-1)^n)*(n-1)*hypergeom([-n+2, 2], [], 1), n>=1; 1 for n=0. - Wolfdieter Lang, Aug 16 2010
a(n) = (-1)^n * hypergeom([ -n, 1], [], 1), n>=1; 1 for n=0. From the binomial convolution due to the e.g.f. - Wolfdieter Lang, Aug 26 2010
Integral_{x=0..1} x^n*exp(x) = (-1)^n*(a(n)*e - n!).
O.g.f.: Sum_{n>=0} n^n*x^n/(1 + (n+1)*x)^(n+1). - Paul D. Hanna, Oct 06 2011
Abs((a(n) + a(n-1))*e - (A000142(n) + A000142(n-1))) < 2/n. - Seiichi Kirikami, Oct 17 2011
G.f.: hypergeom([1,1],[],x/(x+1))/(x+1). - Mark van Hoeij, Nov 07 2011
From Sergei N. Gladkovskii, Nov 25 2011, Jul 05 2012, Sep 23 2012, Oct 13 2012, Mar 09 2013, Mar 10 2013, Oct 18 2013: (Start)
Continued fractions:
In general, e.g.f. (1+a*x)/exp(b*x) = U(0) with U(k) = 1 + a*x/(1-b/(b-a*(k+1)/U(k+1))). For a=-1, b=-1: exp(-x)/(1-x) = 1/U(0).
E.g.f.: (1-x/(U(0)+x))/(1-x), where U(k) = k+1 - x + (k+1)*x/U(k+1).
E.g.f.: 1/Q(0) where Q(k) = 1 - x/(1 - 1/(1 - (k+1)/Q(k+1))).
G.f.: 1/U(0) where U(k) = 1 + x - x*(k+1)/(1 - x*(k+1)/U(k+1)).
G.f.: Q(0)/(1+x) where Q(k) = 1 + (2*k+1)*x/((1+x)-2*x*(1+x)*(k+1)/(2*x*(k+1)+(1+x)/ Q(k+1))).
G.f.: 1/Q(0) where Q(k) = 1 - 2*k*x - x^2*(k + 1)^2/Q(k+1).
G.f.: T(0) where T(k) = 1 - x^2*(k+1)^2/(x^2*(k+1)^2-(1-2*x*k)*(1-2*x-2*x*k)/T(k+1)). (End)
0 = a(n)*(a(n+1) + a(n+2) - a(n+3)) + a(n+1)*(a(n+1) + 2*a(n+2) - a(n+3)) + a(n+2)*a(n+2) if n>=0. - Michael Somos, Jan 25 2014
a(n) = Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*(k + x)^k*(k + x + 1)^(n-k) = Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*(k + x)^(n-k)*(k + x - 1)^k, for arbitrary x. - Peter Bala, Feb 19 2017
From Peter Luschny, Jun 20 2017: (Start)
a(n) = Sum_{j=0..n} Sum_{k=0..n} binomial(-j-1, -n-1)*abs(Stirling1(j, k)).
a(n) = Sum_{k=0..n} (-1)^(n-k)*Pochhammer(n-k+1, k) (cf. A008279). (End)
a(n) = n! - Sum_{j=0..n-1} binomial(n,j) * a(j). - Alois P. Heinz, Jan 23 2019
Sum_{n>=2} 1/a(n) = A281682. - Amiram Eldar, Nov 09 2020
a(n) = KummerU(-n, -n, -1). - Peter Luschny, May 10 2022
a(n) = (-1)^n*Sum_{k=0..n} Bell(k)*Stirling1(n+1, k+1). - Mélika Tebni, Jul 05 2022

Extensions

Minor edits by M. F. Hasler, Jan 16 2017

A068985 Decimal expansion of 1/e.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 08 2002

Keywords

Comments

From the "derangements" problem: this is the probability that if a large number of people are given their hats at random, nobody gets their own hat.
Also, decimal expansion of cosh(1)-sinh(1). - Mohammad K. Azarian, Aug 15 2006
Also, this is lim_{n->inf} P(n), where P(n) is the probability that a random rooted forest on [n] is a tree. See linked file. - Washington Bomfim, Nov 01 2010
Also, location of the minimum of x^x. - Stanislav Sykora, May 18 2012
Also, -1/e is the global minimum of x*log(x) at x = 1/e and the global minimum of x*e^x at x = -1. - Rick L. Shepherd, Jan 11 2014
Also, the asymptotic probability of success in the secretary problem (also known as the sultan's dowry problem). - Andrey Zabolotskiy, Sep 14 2019
The asymptotic density of numbers with an odd number of trailing zeros in their factorial base representation (A232745). - Amiram Eldar, Feb 26 2021
For large range size s where numbers are chosen randomly r times, the probability when r = s that a number is randomly chosen exactly 1 time. Also the chance that a number was not chosen at all. The general case for the probability of being chosen n times is (r/s)^n / (n! * e^(r/s)). - Mark Andreas, Oct 25 2022

Examples

			1/e = 0.3678794411714423215955237701614608674458111310317678... = A135005/5.
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, Sections 1.3 and 5,23,3, pp. 14, 409.
  • Anders Hald, A History of Probability and Statistics and Their Applications Before 1750, Wiley, NY, 1990 (Chapter 19).
  • John Harris, Jeffry L. Hirst, and Michael Mossinghoff, Combinatorics and Graph Theory, Springer Science & Business Media, 2009, p. 161.
  • L. B. W. Jolley, Summation of Series, Dover, 1961, eq. (103) on page 20.
  • Traian Lalescu, Problem 579, Gazeta Matematică, Vol. 6 (1900-1901), p. 148.
  • John Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 65.
  • Manfred R. Schroeder, Number Theory in Science and Communication, Springer Science & Business Media, 2008, ch. 9.5 Derangements.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 26, page 233.
  • Walter D. Wallis and John C. George, Introduction to Combinatorics, CRC Press, 2nd ed. 2016, theorem 5.2 (The Derangement Series).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987, p. 27.

Crossrefs

Cf. A059193.
Cf. asymptotic probabilities of success for other "nothing but the best" variants of the secretary problem: A325905, A242674, A246665.

Programs

Formula

Equals 2*(1/3! + 2/5! + 3/7! + ...). [Jolley]
Equals 1 - Sum_{i >= 1} (-1)^(i - 1)/i!. [Michon]
Equals lim_{x->infinity} (1 - 1/x)^x. - Arkadiusz Wesolowski, Feb 17 2012
Equals j_1(i)/i = cos(i) + i*sin(i), where j_1(z) is the spherical Bessel function of the first kind and i = sqrt(-1). - Stanislav Sykora, Jan 11 2017
Equals Sum_{i>=0} ((-1)^i)/i!. - Maciej Kaniewski, Sep 10 2017
Equals Sum_{i>=0} ((-1)^i)(i^2+1)/i!. - Maciej Kaniewski, Sep 12 2017
From Peter Bala, Oct 23 2019: (Start)
The series representation 1/e = Sum_{k >= 0} (-1)^k/k! is the case n = 0 of the following series acceleration formulas:
1/e = n!*Sum_{k >= 0} (-1)^k/(k!*R(n,k)*R(n,k+1)), n = 0,1,2,..., where R(n,x) = Sum_{k = 0..n} (-1)^k*binomial(n,k)*k!*binomial(-x,k) are the row polynomials of A094816. (End)
1/e = 1 - Sum_{n >= 0} n!/(A(n)*A(n+1)), where A(n) = A000522(n). - Peter Bala, Nov 13 2019
Equals Integral_{x=0..1} x * sinh(x) dx. - Amiram Eldar, Aug 14 2020
Equals lim_{x->oo} (x!)^(1/x)/x. - L. Joris Perrenet, Dec 08 2020
Equals lim_{n->oo} (n+1)!^(1/(n+1)) - n!^(1/n) (Lalescu, 1900-1901). - Amiram Eldar, Mar 29 2022

Extensions

More terms from Rick L. Shepherd, Jan 11 2014

A000466 a(n) = 4*n^2 - 1.

Original entry on oeis.org

-1, 3, 15, 35, 63, 99, 143, 195, 255, 323, 399, 483, 575, 675, 783, 899, 1023, 1155, 1295, 1443, 1599, 1763, 1935, 2115, 2303, 2499, 2703, 2915, 3135, 3363, 3599, 3843, 4095, 4355, 4623, 4899, 5183, 5475, 5775, 6083, 6399, 6723, 7055, 7395
Offset: 0

Views

Author

Chan Siu Kee (skchan5(AT)hkein.ie.cuhk.hk)

Keywords

Comments

Sum_{n>=1} (-1)^n*a(n)/n! = 1 - 1/e = A068996. - Gerald McGarvey, Nov 06 2007
Sequence arises from reading the line from -1, in the direction -1, 15, ... and the same line from 3, in the direction 3, 35, ..., in the square spiral whose nonnegative vertices are the squares A000290. - Omar E. Pol, May 24 2008
a(n) is the product of the consecutive odd integers 2n-1 and 2n+1 (cf. A005408). - Doug Bell, Mar 08 2009
For n>0: a(n) = A176271(2*n,n); cf. A016754, A053755. - Reinhard Zumkeller, Apr 13 2010
a(n+1) gives the curvature c(n) of the n-th circle touching the two equal semicircles of the symmetric arbelos (1/2, 1/2) and the (n-1)-st circle, with input c(0) = 3 = A059100(1) (referring to the second circle of the Pappus chain), for n >= 0. - Wolfdieter Lang and Kival Ngaokrajang, Jul 03 2015
After 3, a(n) is pseudoprime to base 2n. For example: (2*2)^(a(2)-1) == 1 (mod a(2)), in fact 4^14 = 15*17895697+1. - Bruno Berselli, Sep 24 2015
Numbers m such that m+1 and (m+1)/4 are squares. - Bruno Berselli, Mar 03 2016
After -1, the least common multiple of 2*m+1 and 2*m-1. - Colin Barker, Feb 11 2017
This sequence contains all products of the twin prime pairs (see A037074). - Charles Kusniec, Oct 03 2019

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 3.
  • L. B. W. Jolley, Summation of Series, Dover, 2nd ed., 1961.
  • Granino A. Korn and Theresa M. Korn, Mathematical Handbook for Scientists and Engineers, McGraw-Hill Book Company, New York (1968), pp. 980-981.
  • A. Languasco and A. Zaccagnini, Manuale di Crittografia, Ulrico Hoepli Editore (2015), p. 259.

Crossrefs

Factor of A160466. Superset of A037074.
Cf. A059100 (curvatures for a Pappus chain).

Programs

Formula

O.g.f.: ( 1-6*x-3*x^2 ) / (x-1)^3 . - R. J. Mathar, Mar 24 2011
E.g.f.: (-1 + 4*x + 4*x^2)*exp(x). - Ilya Gutkovskiy, May 26 2016
Sum_{n>=1} 1/a(n) = 1/2 [Jolley eq. 233]. - Benoit Cloitre, Apr 05 2002
Sum_{n>=1} 2/a(n) = 1 = 2/3 + 2/15 + 2/35 + 2/63 + 2/99 + 2/143, ..., with partial sums: 2/3, 4/5, 6/7, 8/9, 10/11, 12/13, 14/15, ... - Gary W. Adamson, Jun 16 2003
1/3 + Sum_{n>=2} 4/a(n) = 1 = 1/3 + 4/15 + 4/35 + 4/63, ..., with partial sums: 1/3, 3/5, 5/7, 7/9, 9/11, ..., (2n+1)/(2n+3). - Gary W. Adamson, Jun 18 2003
Sum_{n>=0} 2/a(2*n+1) = Pi/4 = 2/3 + 2/35 + 2/99, ... = (1 - 1/3) + (1/5 - 2/7) + (1/9 - 1/11) + ... = Sum_{n>=0} (-1)^n/(2*n+1). - Gary W. Adamson, Jun 22 2003
Product(n>=1, (a(n)+1)/a(n)) = Pi/2 (Wallis formula). - Mohammed Bouayoun (mohammed.bouayoun(AT)sanef.com), Mar 03 2004
a(n)+2 = A053755(n). - Zak Seidov, Jan 16 2007
a(n)^2 + A008586(n)^2 = A053755(n)^2 (Pythagorean triple). - Zak Seidov, Jan 16 2007
a(n) = a(n-1) + 8*n - 4 for n > 0, a(0)=-1. - Vincenzo Librandi, Dec 17 2010
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - 1/2 = (A019669-1)/2. [Jolley eq (366)]. - R. J. Mathar, Mar 24 2011
For n>0, a(n) = 2/(Integral_{x=0..Pi/2} (sin(x))^3*(cos(x))^(2*n-2)). - Francesco Daddi, Aug 02 2011
Nonlinear recurrence for c(n) = a(n+1) (see the arbelos comment above) from Descartes' three circle theorem (see the links under A259555): c(n) = 4 + c(n-1) + 4*sqrt(c(n-1) + 1), with input c(0) = 3 = A059100(1), for n >= 0. The appropriate solution of this recurrence is c(n-1) + 1 = 4*n^2. - Wolfdieter Lang, Jul 03 2015
a(n) = 3*Pochhammer(5/2,n-1)/Pochhammer(1/2,n-1). Hence, the e.g.f. for a(n+1), i.e., dropping the first term, is 3* 1F1(5/2;1/2;x), with 1F1 being the confluent hypergeometric function (also known as Kummer's). - Stanislav Sykora, May 26 2016
Product_{n>=1} (1 - 1/a(n)) = sin(Pi/sqrt(2))/sqrt(2). - Amiram Eldar, Feb 04 2021

A045531 Number of sticky functions: endofunctions of [n] having a fixed point.

Original entry on oeis.org

1, 3, 19, 175, 2101, 31031, 543607, 11012415, 253202761, 6513215599, 185311670611, 5777672071535, 195881901213181, 7174630439858727, 282325794823047151, 11878335717996660991, 532092356706983938321, 25283323623228812584415, 1270184310304975912766347
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of functions f{1,2,...,n}->{1,2,...,n} with at least one element mapped to 1. - Geoffrey Critzer, Dec 10 2012
Equivalently, a(n) is the number of endofunctions with minimum 1. - Olivier Gérard, Aug 02 2016
Number of bargraphs of width n and height n. Equivalently: number of ordered n-tuples of positive integers such that the largest is n. Example: a(3) = 19 because we have 113, 123, 213, 223, 131, 132, 231, 232, 311, 312, 321, 322, 331, 332, 313, 323, 133, 233, and 333. - Emeric Deutsch, Jan 30 2017

Crossrefs

Column |a(n, 2)| of A039621. Row sums of triangle A055858.
Column k=1 of A246049.

Programs

  • Magma
    [n^n-(n-1)^n: n in [1..20] ]; // Vincenzo Librandi, May 07 2011
    
  • Mathematica
    Table[Sum[Binomial[n, i] (n - 1)^(n - i), {i, 1, n}], {n, 1, 20}]
  • Maxima
    a(n) = sum(k!*binomial(n-1,k-1)*stirling2(n,k),k,1,n); /* Vladimir Kruchinin, Mar 01 2014 */
  • PARI
    a(n)=n^n-(n-1)^n; \\ Charles R Greathouse IV, May 08 2011
    

Formula

a(n) = n^n - (n-1)^n.
E.g.f.: (T - x)/(T-T^2), where T=T(x) is Euler's tree function (see A000169).
With interpolated zeros, ceiling(n/2)^ceiling(n/2) - floor(n/2)^ceiling(n/2). - Paul Barry, Jul 13 2005
a(n) = A047969(n,n). - Alford Arnold, May 07 2005
a(n) = Sum_{i=1..n} binomial(n,i)*(i-1)^(i-1)*(n-i)^(n-i) = Sum_{i=1..n} binomial(n,i)*A000312(i-1)*A000312(n-i). - Vladimir Shevelev, Sep 30 2010
a(n) = Sum_{k=1..n} k!*binomial(n-1,k-1)*Stirling2(n,k). - Vladimir Kruchinin, Mar 01 2014
a(n) = A350454(n+1, 1) / (n+1). - Mélika Tebni, Dec 20 2022
Limit_{n->oo} a(n)/n^n = 1 - 1/e = A068996. - Luc Rousseau, Jan 20 2023

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))).

A166356 Expansion of e.g.f. 1 + x*arctanh(x), even powers only.

Original entry on oeis.org

1, 2, 8, 144, 5760, 403200, 43545600, 6706022400, 1394852659200, 376610217984000, 128047474114560000, 53523844179886080000, 26976017466662584320000, 16131658445064225423360000, 11292160911544957796352000000, 9146650338351415815045120000000
Offset: 0

Views

Author

Paul Barry, Oct 12 2009

Keywords

Comments

For n>0, (4*n-1)*a(n) corresponds to the number of random walk labelings of the friendship graph F_n (i.e., the one-point union of n triangles). - Sela Fried, May 20 2023

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := (2*n - 1)! + (2*n - 2)!; Array[a, 14, 0] (* Amiram Eldar, Jan 02 2022 *)
    With[{nn=40},Take[CoefficientList[Series[1+x ArcTanh[x],{x,0,nn}],x] Range[0,nn]!,{1,-1,2}]] (* Harvey P. Dale, Apr 15 2024 *)

Formula

E.g.f.: 1 + x*arctanh(x) has expansion 1, 0, 2, 0, 8, 0, 144, ...
a(n) = (2n-1)! + (2n-2)! for n > 0; a(0) = 1.
a(n) -2*n*(2*n-3)*a(n-1) = 0. - R. J. Mathar, Nov 24 2012
G.f.: 1 + x*G(0), where G(k) = 1 + 1/(1 - (k+2)*x/( (k+2)*x + (k+1)/((2*k+1)*(2*k+2))/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jul 08 2013
From Amiram Eldar, Jan 02 2022: (Start)
Sum_{n>=0} 1/a(n) = 2 - 1/e = 1 + A068996.
Sum_{n>=0} (-1)^n/a(n) = 2 - cos(1) - sin(1) = 2 - A143623. (End)

A288907 Primes p whose distance from the next prime and from the previous prime is less than log(p).

Original entry on oeis.org

71, 101, 103, 107, 109, 193, 197, 227, 229, 281, 311, 313, 349, 433, 439, 443, 461, 463, 503, 563, 569, 571, 593, 599, 601, 607, 613, 617, 643, 647, 653, 659, 677, 733, 739, 757, 823, 827, 857, 859, 881, 883, 941, 947, 971, 977, 1013, 1019, 1033, 1063, 1091, 1093
Offset: 1

Views

Author

Giuseppe Coppoletta, Jun 19 2017

Keywords

Comments

Primes preceded and followed by less-than-average prime gaps (by the Prime Number Theorem, see link).
This sequence is a subsequence of A381850 and of A383652. - Alain Rocchelli, May 07 2025

Examples

			n = 23 is not a term because 23 - 19 > log(23) = 3.13...
n = 71 is a term because log(71) = 4.71.. and 73 - log(71) < 71 < 67 + log(71).
		

Crossrefs

Programs

  • Maple
    q:= p-> isprime(p) and is(max(nextprime(p)-p, p-prevprime(p))Alois P. Heinz, May 12 2025
  • Mathematica
    Select[Range[2, 220] // Prime, Max[ Abs[# - NextPrime[#, {-1, 1}]]] < Log[#] &] (* Giovanni Resta, Jun 19 2017 *)
  • PARI
    is(n) = ispseudoprime(n) && n-precprime(n-1) < log(n) && nextprime(n+1)-n < log(n) \\ Felix Fröhlich, Jun 19 2017
  • Sage
    [n for n in prime_range(3,1300) if next_prime(n)-n
    				

Formula

A151800(a(n)) - log(a(n)) < a(n) < A151799(a(n)) + log(a(n)).
Conjecture: Limit_{n->oo} n / PrimePi(a(n)) = (1-1/e)^2 (A068996). - Alain Rocchelli, May 07 2025

A306858 Decimal expansion of 1 - 1/(1*3) + 1/(1*3*5) - 1/(1*3*5*7) + ...

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Jun 24 2019

Keywords

Examples

			0.7247784590070763318182279676062161663121329...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[Sqrt[Pi/(2 Exp[1])] Erfi[1/Sqrt[2]], 10, 110] [[1]]
    RealDigits[Sqrt[2] DawsonF[1/Sqrt[2]], 10, 110] [[1]]

Formula

Equals sqrt(Pi/(2*exp(1)))*erfi(1/sqrt(2)), where erfi is the imaginary error function.
Equals (1/sqrt(e)) * Sum_{k>=0} 1/(2^k * k! * (2*k+1)) = 1/(sqrt(e)) * Sum_{k>=0} 1/A014481(k). - Amiram Eldar, Nov 12 2021
Equals 1/(1+A113014). - Jon Maiga, Nov 12 2021

A248788 Decimal expansion of (2-sqrt(e))^2, the mean fraction of guests without a napkin in Conway’s napkin problem.

Original entry on oeis.org

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

Views

Author

Jean-François Alcover, Oct 14 2014

Keywords

Examples

			0.12339674565853264796568432009600821114214269085936752866665...
		

Crossrefs

Programs

  • Mathematica
    RealDigits[(2 - Sqrt[E])^2, 10, 100] // First
  • PARI
    (2-exp(1/2))^2 \\ Charles R Greathouse IV, Oct 31 2014

Formula

Equals lim_{n->oo} A341232(n)/A341233(n). - Pontus von Brömssen, Feb 08 2021

A248873 a(n) = floor(e^(n+1) - e^n).

Original entry on oeis.org

1, 4, 12, 34, 93, 255, 693, 1884, 5122, 13923, 37847, 102880, 279658, 760190, 2066413, 5617093, 15268842, 41505016, 112822331, 306682894, 833650539, 2266097111, 6159890600, 16744318683, 45515777207, 123724710091, 336318631172, 914208823689, 2485077232852, 6755140284380
Offset: 0

Views

Author

Danny Rorabaugh, Mar 04 2015

Keywords

Comments

e^(n+1)-e^n-1 < a(n) <= A064780(n) <= a(n)+1 < e^(n+1)-e^n+1.
Lim_{n->infinity} a(n)/e^(n+1) = (e-1)/e. [Corrected by Altug Alkan, Apr 25 2018]

Crossrefs

Programs

  • Mathematica
    Floor[#[[2]]-#[[1]]]&/@Partition[E^Range[0,30],2,1] (* Harvey P. Dale, Jul 24 2018 *)
  • PARI
    vector(30, n, n--; floor(exp(n+1)-exp(n))) \\ Michel Marcus, Mar 06 2015

Formula

a(n) = floor(e^(n+1)-e^n).
Showing 1-10 of 18 results. Next