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 11 results. Next

A000587 Rao Uppuluri-Carpenter numbers (or complementary Bell numbers): e.g.f. = exp(1 - exp(x)).

Original entry on oeis.org

1, -1, 0, 1, 1, -2, -9, -9, 50, 267, 413, -2180, -17731, -50533, 110176, 1966797, 9938669, 8638718, -278475061, -2540956509, -9816860358, 27172288399, 725503033401, 5592543175252, 15823587507881, -168392610536153, -2848115497132448, -20819319685262839
Offset: 0

Views

Author

Keywords

Comments

Alternating row sums of Stirling2 triangle A048993.
Related to the matrix-exponential of the Pascal-matrix, see A000110 and A011971. - Gottfried Helms, Apr 08 2007
Closely linked to A000110 and especially the contribution there of Jonathan R. Love (japanada11(AT)yahoo.ca), Feb 22 2007, by offering what is a complementary finding.
Number of set partitions of 1..n with an even number of parts, minus the number of such partitions with an odd number of parts. - Franklin T. Adams-Watters, May 04 2010
After -2, the smallest prime is a(36) = -1454252568471818731501051, no others through a(100). What is the first prime >0 in the sequence? - Jonathan Vos Post, Feb 02 2011
a(723) ~ 1.9*10^1265 is almost certainly prime. - D. S. McNeil, Feb 02 2011
Stirling transform of a(n) = [1, -1, 0, 1, 1, ...] is A033999(n) = [1, -1, 1, -1, 1, ...]. - Michael Somos, Mar 28 2012
Negated coefficients in the asymptotic expansion: A005165(n)/n! ~ 1 - 1/n + 1/n^2 + 0/n^3 - 1/n^4 - 1/n^5 + 2/n^6 + 9/n^7 + 9/n^8 - 50/n^9 - 267/n^10 - 413/n^11 + O(1/n^12), starting from the O(1/n) term. - Vladimir Reshetnikov, Nov 09 2016
Named after Venkata Ramamohana Rao Uppuluri and John A. Carpenter of the Mathematics Division, Oak Ridge National Laboratory, Oak Ridge, Tennessee. They are called "Rényi numbers" by Fekete (1999), after the Hungarian mathematician Alfréd Rényi (1921-1970). - Amiram Eldar, Mar 11 2022

Examples

			G.f. = 1 - x + x^3 + x^4 - 2*x^5 - 9*x^6 - 9*x^7 + 50*x^8 + 267*x^9 + 413*x^10 - ...
		

References

  • N. A. Kolokolnikova, Relations between sums of certain special numbers (Russian), in Asymptotic and enumeration problems of combinatorial analysis, pp. 117-124, Krasnojarsk. Gos. Univ., Krasnoyarsk, 1976.
  • Alfréd Rényi, Új modszerek es eredmenyek a kombinatorikus analfzisben. I. MTA III Oszt. Ivozl., Vol. 16 (1966), pp. 7-105.
  • 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).
  • M. V. Subbarao and A. Verma, Some remarks on a product expansion. An unexplored partition function, in Symbolic Computation, Number Theory, Special Functions, Physics and Combinatorics (Gainesville, FL, 1999), pp. 267-283, Kluwer, Dordrecht, 2001.

Crossrefs

Cf. A000110, A011971 (base triangle PE), A078937 (PE^2).

Programs

  • Haskell
    a000587 n = a000587_list !! n
    a000587_list = 1 : f a007318_tabl [1] where
       f (bs:bss) xs = y : f bss (y : xs) where y = - sum (zipWith (*) xs bs)
    -- Reinhard Zumkeller, Mar 04 2014
  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1-2*t,
          add(b(n-j, 1-t)*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..35);  # Alois P. Heinz, Jun 28 2016
  • Mathematica
    Table[ -1 * Sum[ (-1)^( k + 1) StirlingS2[ n, k ], {k, 0, n} ], {n, 0, 40} ]
    With[{nn=30},CoefficientList[Series[Exp[1-Exp[x]],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Nov 04 2011 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ Exp[ 1 - Exp[x]], {x, 0, n}]]; (* Michael Somos, May 27 2014 *)
    a[ n_] := If[ n < 0, 0, With[{m = n + 1}, SeriesCoefficient[ Series[ Nest[ x Factor[ 1 - # /. x -> x / (1 - x)] &, 0, m], {x, 0, m}], {x, 0, m}]]]; (* Michael Somos, May 27 2014 *)
    Table[BellB[n, -1], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 20 2015 *)
    b[1] = 1; k = 1; Flatten[{1, Table[Do[j = k; k -= b[m]; b[m] = j;, {m, 1, n-1}]; b[n] = k; k*(-1)^n, {n, 1, 40}]}] (* Vaclav Kotesovec, Sep 09 2019 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( exp( 1 - exp( x + x * O(x^n))), n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    {a(n) = local(A); if( n<0, 0, n++; A = O(x); for( k=1, n, A = x - x * subst(A, x, x / (1 - x))); polcoeff( A, n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    Vec(serlaplace(exp(1 - exp(x+O(x^99))))) /* Joerg Arndt, Apr 01 2011 */
    
  • PARI
    a(n)=round(exp(1)*suminf(k=0,(-1)^k*k^n/k!))
    vector(20,n,a(n-1)) \\ Derek Orr, Sep 19 2014 -- a direct approach
    
  • PARI
    x='x+O('x^66); Vec(serlaplace(exp(1 - exp(x)))) \\ Michel Marcus, Sep 19 2014
    
  • Python
    # The objective of this implementation is efficiency.
    # n -> [a(0), a(1), ..., a(n)] for n > 0.
    def A000587_list(n):
        A = [0 for i in range(n)]
        A[n-1] = 1
        R = [1]
        for j in range(0, n):
            A[n-1-j] = -A[n-1]
            for k in range(n-j, n):
                A[k] += A[k-1]
            R.append(A[n-1])
        return R
    # Peter Luschny, Apr 18 2011
    
  • Python
    # Python 3.2 or higher required
    from itertools import accumulate
    A000587, blist, b = [1,-1], [1], -1
    for _ in range(30):
        blist = list(accumulate([b]+blist))
        b = -blist[-1]
        A000587.append(b) # Chai Wah Wu, Sep 19 2014
    
  • Sage
    expnums(26, -1) # Zerinvary Lajos, May 15 2009
    

Formula

a(n) = e*Sum_{k>=0} (-1)^k*k^n/k!. - Benoit Cloitre, Jan 28 2003
E.g.f.: exp(1 - e^x).
a(n) = Sum_{k=0..n} (-1)^k S2(n, k), where S2(i, j) are the Stirling numbers of second kind A008277.
G.f.: (x/(1-x))*A(x/(1-x)) = 1 - A(x); the binomial transform equals the negative of the sequence shifted one place left. - Paul D. Hanna, Dec 08 2003
With different signs: g.f.: Sum_{k>=0} x^k/Product_{L=1..k} (1 + L*x).
Recurrence: a(n) = -Sum_{i=0..n-1} a(i)*C(n-1, i). - Ralf Stephan, Feb 24 2005
Let P be the lower-triangular Pascal-matrix, PE = exp(P-I) a matrix-exponential in exact integer arithmetic (or PE = lim exp(P)/exp(1) as limit of the exponential); then a(n) = PE^-1 [n,1]. - Gottfried Helms, Apr 08 2007
Take the series 0^n/0! - 1^n/1! + 2^n/2! - 3^n/3! + 4^n/4! + ... If n=0 then the result will be 1/e, where e = 2.718281828... If n=1, the result will be -1/e. If n=2, the result will be 0 (i.e., 0/e). As we continue for higher natural number values of n sequence for the Roa Uppuluri-Carpenter numbers is generated in the numerator, i.e., 1/e, -1/e, 0/e, 1/e, 1/e, -2/e, -9/e, -9/e, 50/e, 267/e, ... . - Peter Collins (pcolins(AT)eircom.net), Jun 04 2007
The sequence (-1)^n*a(n), with general term Sum_{k=0..n} (-1)^(n-k)*S2(n, k), has e.g.f. exp(1-exp(-x)). It also has Hankel transform (-1)^C(n+1,2)*A000178(n) and binomial transform A109747. - Paul Barry, Mar 31 2008
G.f.: 1 / (1 + x / (1 - x / (1 + x / (1 - 2*x / (1 + x / (1 - 3*x / (1 + x / ...))))))). - Michael Somos, May 12 2012
From Sergei N. Gladkovskii, Sep 28 2012 to Feb 07 2014: (Start)
Continued fractions:
G.f.: -1/U(0) where U(k) = x*k - 1 - x + x^2*(k+1)/U(k+1).
G.f.: 1/(U(0)+x) where U(k) = 1 + x - x*(k+1)/(1 + x/U(k+1)).
G.f.: 1+x/G(0) where G(k) = x*k - 1 + x^2*(k+1)/G(k+1).
G.f.: (1 - G(0))/(x+1) where G(k) = 1 - 1/(1-k*x)/(1-x/(x+1/G(k+1) )).
G.f.: 1 + x/(G(0)-x) where G(k) = x*k + 2*x - 1 - x*(x*k+x-1)/G(k+1).
G.f.: G(0)/(1+x), where G(k) = 1-x^2*(k+1)/(x^2*(k+1)+(x*k-1-x)*(x*k-1)/G(k+1)).
(End)
a(n) = B_n(-1), where B_n(x) is n-th Bell polynomial. - Vladimir Reshetnikov, Oct 20 2015
From Mélika Tebni, May 20 2022: (Start)
a(n) = Sum_{k=0..n} (-1)^k*Bell(k)*A129062(n, k).
a(n) = Sum_{k=0..n} (-1)^k*k!*A130191(n, k). (End)

A003422 Left factorials: !n = Sum_{k=0..n-1} k!.

Original entry on oeis.org

0, 1, 2, 4, 10, 34, 154, 874, 5914, 46234, 409114, 4037914, 43954714, 522956314, 6749977114, 93928268314, 1401602636314, 22324392524314, 378011820620314, 6780385526348314, 128425485935180314, 2561327494111820314, 53652269665821260314, 1177652997443428940314
Offset: 0

Views

Author

Keywords

Comments

Number of {12, 12*, 1*2, 21*}- and {12, 12*, 21, 21*}-avoiding signed permutations in the hyperoctahedral group.
a(n) is the number of permutations on [n] that avoid the patterns 2n1 and n12. An occurrence of a 2n1 pattern is a (scattered) subsequence a-n-b with a > b. - David Callan, Nov 29 2007
Also, numbers left over after the following sieving process: At step 1, keep all numbers of the set N = {0, 1, 2, ...}. In step 2, keep only every second number after a(2) = 2: N' = {0, 1, 2, 4, 6, 8, 10, ...}. In step 3, keep every third of the numbers following a(3) = 4, N" = {0, 1, 2, 4, 10, 16, 22, ...}. In step 4, keep every fourth of the numbers beyond a(4) = 10: {0, 1, 2, 4, 10, 34, 58, ...}, and so on. - M. F. Hasler, Oct 28 2010
If s(n) is a second-order recurrence defined as s(0) = x, s(1) = y, s(n) = n*(s(n - 1) - s(n - 2)), n > 1, then s(n) = n*y - n*a(n - 1)*x. - Gary Detlefs, May 27 2012
a(n) is the number of lists of {1, ..., n} with (1st element) = (smallest element) and (k-th element) <> (k-th smallest element) for k > 1, where a list means an ordered subset. a(4) = 10 because we have the lists: [1], [2], [3], [4], [1, 3, 2], [1, 4, 2], [1, 4, 3], [2, 4, 3], [1, 3, 4, 2], [1, 4, 2, 3]. Cf. A000262. - Geoffrey Critzer, Oct 04 2012
Consider a tree graph with 1 vertex. Add an edge to it with another vertex. Now add 2 edges with vertices to this vertex, and then 3 edges to each open vertex of the tree (not the first one!), and the next stage is to add 4 edges, and so on. The total number of vertices at each stage give this sequence (see example). - Jon Perry, Jan 27 2013
Additive version of the superfactorials A000178. - Jon Perry, Feb 09 2013
Repunits in the factorial number system (see links). - Jon Perry, Feb 17 2013
Whether n|a(n) only for 1 and 2 remains an open problem. A published 2004 proof was retracted in 2011. This is sometimes known as Kurepa's conjecture. - Robert G. Wilson v, Jun 15 2013, corrected by Jeppe Stig Nielsen, Nov 07 2015.
!n is not always squarefree for n > 3. Miodrag Zivkovic found that 54503^2 divides !26541. - Arkadiusz Wesolowski, Nov 20 2013
a(n) gives the position of A007489(n) in A227157. - Antti Karttunen, Nov 29 2013
Matches the total domination number of the Bruhat graph from n = 2 to at least n = 5. - Eric W. Weisstein, Jan 11 2019
For the connection with Kurepa trees, see A. Petojevic, The {K_i(z)}{i=1..oo} functions, Rocky Mtn. J. Math., 36 (2006), 1637-1650. - _Aleksandar Petojevic, Jun 29 2018
This sequence converges in the p-adic topology, for every prime number p. - Harry Richman, Aug 13 2024

Examples

			!5 = 0! + 1! + 2! + 3! + 4! = 1 + 1 + 2 + 6 + 24 = 34.
x + 2*x^2 + 4*x^3 + 10*x^4 + 34*x^5 + 154*x^6 + 874*x^7 + 5914*x^8 + 46234*x^9 + ...
From _Arkadiusz Wesolowski_, Aug 06 2012: (Start)
Illustration of initial terms:
.
. o        o         o            o                         o
.          o         o            o                         o
.                   o o          o o                       o o
.                              ooo ooo                   ooo ooo
.                                             oooo oooo oooo oooo oooo oooo
.
. 1        2         4            10                        34
.
(End)
The tree graph. The total number of vertices at each stage is 1, 2, 4, 10, ...
    0 0
    |/
    0-0
   /
0-0
   \
    0-0
    |\
    0 0
- _Jon Perry_, Jan 27 2013
		

References

  • Richard K. Guy, Unsolved Problems Number Theory, Section B44.
  • D. Kurepa, On the left factorial function !n. Math. Balkanica 1 1971 147-153.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003422 n = a003422_list !! n
    a003422_list = scanl (+) 0 a000142_list
    -- Reinhard Zumkeller, Dec 27 2011
    
  • Maple
    A003422 := proc(n) local k; add(k!,k=0..n-1); end proc:
    # Alternative, using the Charlier polynomials A137338:
    C := proc(n, x) option remember; if n > 0 then (x-n)*C(n-1, x) - n*C(n-2, x)
    elif n = 0 then 1 else 0 fi end: A003422 := n -> (-1)^(n+1)*C(n-1, -1):
    seq(A003422(n), n=0..22); # Peter Luschny, Nov 28 2018
    # third Maple program:
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+(n-1)!) end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Feb 24 2022
  • Mathematica
    Table[Sum[i!, {i, 0, n - 1}], {n, 0, 20}] (* Stefan Steinerberger, Mar 31 2006 *)
    Join[{0}, Accumulate[Range[0, 25]!]] (* Harvey P. Dale, Nov 19 2011 *)
    a[0] = 0; a[1] = 1; a[n_] := a[n] = n*a[n - 1] - (n - 1)*a[n - 2]; Array[a, 23, 0] (* Robert G. Wilson v, Jun 15 2013 *)
    a[n_] := (-1)^n*n!*Subfactorial[-n-1]-Subfactorial[-1]; Table[a[n] // FullSimplify, {n, 0, 22}] (* Jean-François Alcover, Jan 09 2014 *)
    RecurrenceTable[{a[n] == n a[n - 1] - (n - 1) a[n - 2], a[0] == 0, a[1] == 1}, a, {n, 0, 10}] (* Eric W. Weisstein, Jan 11 2019 *)
    Range[0, 20]! CoefficientList[Series[(ExpIntegralEi[1] - ExpIntegralEi[1 - x]) Exp[x - 1], {x, 0, 20}], x] (* Eric W. Weisstein, Jan 11 2019 *)
    Table[(-1)^n n! Subfactorial[-n - 1] - Subfactorial[-1], {n, 0, 20}] // FullSimplify (* Eric W. Weisstein, Jan 11 2019 *)
    Table[(I Pi + ExpIntegralEi[1] + (-1)^n n! Gamma[-n, -1])/E, {n, 0, 20}] // FullSimplify (* Eric W. Weisstein, Jan 11 2019 *)
  • Maxima
    makelist(sum(k!,k,0,n-1), n, 0, 20); /* Stefano Spezia, Jan 11 2019 */
    
  • PARI
    a003422(n)=sum(k=0,n-1,k!) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from itertools import count, islice
    def A003422_gen(): # generator of terms
        yield from (0,1)
        c, f = 1, 1
        for n in count(1):
            yield (c:= c + (f:= f*n))
    A003422_list = list(islice(A003422_gen(),20)) # Chai Wah Wu, Jun 22 2022
    
  • Python
    def a(n):
        if n == 0: return 0
        s = f = 1
        for k in range(1, n):
            f *= k
            s += f
        return round(s)
    print([a(n) for n in range(24)])  # Peter Luschny, Mar 05 2024

Formula

D-finite with recurrence: a(n) = n*a(n - 1) - (n - 1)*a(n - 2). - Henry Bottomley, Feb 28 2001
Sequence is given by 1 + 1*(1 + 2*(1 + 3*(1 + 4*(1 + ..., terminating in n*(1)...). - Jon Perry, Jun 01 2004
a(n) = Sum_{k=0..n-1} P(n, k) / C(n, k). - Ross La Haye, Sep 20 2004
E.g.f.: (Ei(1) - Ei(1 - x))*exp(-1 + x) where Ei(x) is the exponential integral. - Djurdje Cvijovic and Aleksandar Petojevic, Apr 11 2000
a(n) = Integral_{x = 0..oo} [(x^n - 1)/(x - 1)]*exp(-x) dx. - Gerald McGarvey, Oct 12 2007
A007489(n) = !(n + 1) - 1 = a(n + 1) - 1. - Artur Jasinski, Nov 08 2007. Typos corrected by Antti Karttunen, Nov 29 2013
Starting (1, 2, 4, 10, 34, 154, ...), = row sums of triangle A135722. - Gary W. Adamson, Nov 25 2007
a(n) = a(n - 1) + (n - 1)! for n >= 2. - Jaroslav Krizek, Jun 16 2009
E.g.f. A(x) satisfies the differential equation A'(x) = A(x) + 1/(1 - x). - Vladimir Kruchinin, Jan 19 2011
a(n + 1) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = A182386(k) for k = 0, 1, ..., n. - Michael Somos, Apr 27 2012
From Sergei N. Gladkovskii, May 09 2013 to Oct 22 2013: (Start)
Continued fractions:
G.f.: x/(1-x)*Q(0) where Q(k) = 1 + (2*k + 1)*x/( 1 - 2*x*(k+1)/(2*x*(k+1) + 1/Q(k+1))).
G.f.: G(0)*x/(1-x)/2 where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + 1/G(k+1))).
G.f.: 2*x/(1-x)/G(0) where G(k) = 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))).
G.f.: W(0)*x/(1+sqrt(x))/(1-x) where W(k) = 1 + sqrt(x)/(1 - sqrt(x)*(k+1)/(sqrt(x)*(k+1) + 1/W(k+1))).
G.f.: B(x)*(1+x)/(1-x) where B(x) is the g.f. of A153229.
G.f.: x/(1-x) + x^2/(1-x)/Q(0) where Q(k) = 1 - 2*x*(2*k+1) - x^2*(2*k+1)*(2*k+2)/(1 - 2*x*(2*k+2) - x^2*(2*k+2)*(2*k+3)/Q(k+1)).
G.f.: x*(1+x)*B(x) where B(x) is the g.f. of A136580. (End)
a(n) = (-1)^(n+1)*C(n-1, -1) where C(n, x) are the Charlier polynomials (with parameter a=1) as given in A137338. (Evaluation at x = 1 gives A232845.) - Peter Luschny, Nov 28 2018
a(n) = (a(n-3)*(n-2)^2*(n-3)! + a(n-1)^2)/a(n-2) (empirical). - Gary Detlefs, Feb 25 2022
a(n) = signum(n)/b(1,n) with b(i,n) = i - [iMohammed Bouras, Sep 07 2022
Sum_{n>=1} 1/a(n) = A357145. - Amiram Eldar, Oct 01 2022

A073003 Decimal expansion of -exp(1)*Ei(-1), also called Gompertz's constant, or the Euler-Gompertz constant.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 03 2002

Keywords

Comments

0! - 1! + 2! - 3! + 4! - 5! + ... = (Borel) Sum_{n>=0} (-y)^n n! = KummerU(1,1,1/y)/y.
Decimal expansion of phi(1) where phi(x) = Integral_{t>=0} e^-t/(x+t) dt. - Benoit Cloitre, Apr 11 2003
The divergent series g(x=1,m) = 1^m*1! - 2^m*2! + 3^m*3! - 4^m*4! + ..., m => -1, is intimately related to Gompertz's constant. We discovered that g(x=1,m) = (-1)^m * (A040027(m) - A000110(m+1) * A073003) with A000110 the Bell numbers and A040027 a sequence that was published by Gould, see for more information A163940. - Johannes W. Meijer, Oct 16 2009
Named by Le Lionnais (1983) after the English self-educated mathematician and actuary Benjamin Gompertz (1779 - 1865). It was named the Euler-Gompertz constant by Finch (2003). Lagarias (2013) noted that he has not located this constant in Gompertz's writings. - Amiram Eldar, Aug 15 2020

Examples

			0.59634736232319407434107849936927937607417786015254878157348491...
With n := 10^5, Sum_{k >= 0} (n/(n + 1))^k/(n + k) = 0.5963(51...). - _Peter Bala_, Jun 19 2024
		

References

  • Bruce C. Berndt, Ramanujan's notebooks Part II, Springer, p. 171
  • Bruce C. Berndt, Ramanujan's notebooks Part I, Springer, p. 144-145.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 303, 424-425.
  • Francois Le Lionnais, Les nombres remarquables, Paris: Hermann, 1983. See p. 29.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 44, page 426.
  • H. S. Wall, Analytic Theory of Continued Fractions, Van Nostrand, New York, 1948, p. 356.

Crossrefs

Cf. A000522 (arrangements), A001620, A000262, A002720, A002793, A058006 (alternating factorial sums), A091725, A099285, A153229, A201203, A245780, A283743 (Ei(1)/e), A321942, A369883.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); ExponentialIntegralE1(1)*Exp(1); // G. C. Greubel, Dec 04 2018
    
  • Mathematica
    RealDigits[N[-Exp[1]*ExpIntegralEi[-1], 105]][[1]]
    (* Second program: *)
    G = 1/Fold[Function[2*#2 - #2^2/#1], 2, Reverse[Range[10^4]]] // N[#, 105]&; RealDigits[G] // First (* Jean-François Alcover, Sep 19 2014 *)
  • PARI
    eint1(1)*exp(1) \\ Charles R Greathouse IV, Apr 23 2013
    
  • Sage
    numerical_approx(exp_integral_e(1,1)*exp(1), digits=100) # G. C. Greubel, Dec 04 2018

Formula

phi(1) = e*(Sum_{k>=1} (-1)^(k-1)/(k*k!) - Gamma) = 0.596347362323194... where Gamma is the Euler constant.
G = 0.596347... = 1/(1+1/(1+1/(1+2/(1+2/(1+3/(1+3/(1+4/(1+4/(1+5/(1+5/(1+6/(... - Philippe Deléham, Aug 14 2005
Equals A001113*A099285. - Johannes W. Meijer, Oct 16 2009
From Peter Bala, Oct 11 2012: (Start)
Stieltjes found the continued fraction representation G = 1/(2 - 1^2/(4 - 2^2/(6 - 3^2/(8 - ...)))). See [Wall, Chapter 18, (92.7) with a = 1]. The sequence of convergents to the continued fraction begins [1/2, 4/7, 20/34, 124/209, ...]. The numerators are in A002793 and the denominators in A002720.
Also, 1 - G has the continued fraction representation 1/(3 - 2/(5 - 6/(7 - ... -n*(n+1)/((2*n+3) - ...)))) with convergents beginning [1/3, 5/13, 29/73, 201/501, ...]. The numerators are in A201203 (unsigned) and the denominators are in A000262.
(End)
G = f(1) with f solution to the o.d.e. x^2*f'(x) + (x+1)*f(x)=1 such that f(0)=1. - Jean-François Alcover, May 28 2013
From Amiram Eldar, Aug 15 2020: (Start)
Equals Integral_{x=0..1} 1/(1-log(x)) dx.
Equals Integral_{x=1..oo} exp(1-x)/x dx.
Equals Integral_{x=0..oo} exp(-x)*log(x+1) dx.
Equals Integral_{x=0..oo} exp(-x)/(x+1) dx. (End)
From Gleb Koloskov, May 01 2021: (Start)
Equals Integral_{x=0..1} LambertW(e/x)-1 dx.
Equals Integral_{x=0..1} 1+1/LambertW(-1,-x/e) dx. (End)
Equals lim_{n->oo} A040027(n)/A000110(n+1). - Vaclav Kotesovec, Feb 22 2021
G = lim_{n->oo} A321942(n)/A000262(n). - Peter Bala, Mar 21 2022
Equals Sum_{n >= 1} 1/(n*L(n, -1)*L(n-1, -1)), where L(n, x) denotes the n-th Laguerre polynomial. This is the case x = 1 of the identity Integral_{t >= 0} exp(-t)/(x + t) dt = Sum_{n >= 1} 1/(n*L(n, -x)*L(n-1, -x)) valid for Re(x) > 0. - Peter Bala, Mar 21 2024
Equals lim_{n->oo} Sum_{k >= 0} (n/(n + 1))^k/(n + k). Cf. A099285. - Peter Bala, Jun 18 2024

Extensions

Additional references from Gerald McGarvey, Oct 10 2005
Link corrected by Johannes W. Meijer, Aug 01 2009

A058006 Alternating factorials: 0! - 1! + 2! - ... + (-1)^n n!

Original entry on oeis.org

1, 0, 2, -4, 20, -100, 620, -4420, 35900, -326980, 3301820, -36614980, 442386620, -5784634180, 81393657020, -1226280710980, 19696509177020, -335990918918980, 6066382786809020, -115578717622022980, 2317323290554617020, -48773618881154822980
Offset: 0

Views

Author

Henry Bottomley, Nov 13 2000

Keywords

Comments

From Harry Richman, Aug 13 2024: (Start)
Euler argued this sequence converges to 0.596347... (A073003 = Gompertz's constant); see Lagarias Section 2.5.
This sequence converges in the p-adic topology, for every prime number p. (End)

Examples

			a(5) = 0!-1!+2!-3!+4!-5! = 1-1+2-6+24-120 = -100.
G.f. = 1 + 2*x^2 - 4*x^3 + 20*x^4 - 100*x^5 + 620*x^6 - 4420*x^7 + 35900*x^8 + ...
		

Crossrefs

Cf. A000142, A003422, A005165, A153229 (absolute values), A136580.
Partial sums of A133942.

Programs

  • Haskell
    a058006 n = a058006_list !! n
    a058006_list = scanl1 (+) a133942_list
    -- Reinhard Zumkeller, Mar 02 2014
  • Mathematica
    a[ n_] := Sum[ (-1)^k k!, {k, 0, n}]; (* Michael Somos, Jan 28 2014 *)
  • PARI
    {a(n) = sum(k=0, n, (-1)^k * k!)}; /* Michael Somos, Jan 28 2014 */
    

Formula

a(n) = (-1)^n n! + a(n-1) = A005165(n)(-1)^n + 1.
a(n) = -(n-1)*a(n-1) + n*a(n-2), n>0.
E.g.f.: d/dx ((GAMMA(0,1)-GAMMA(0,1+x))*exp(1+x)). - Max Alekseyev, Jul 05 2010
G.f.: G(0)/(1-x), where G(k)= 1 - (2*k + 1)*x/( 1 - 2*x*(k+1)/(2*x*(k+1) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
0 = a(n)*(-a(n+1) + a(n+3)) + a(n+1)*(2*a(n+1) - 2*a(n+2) -a(n+3)) + a(n+2)*(a(n+2)) if n>=-1. - Michael Somos, Jan 28 2014
a(n) = exp(1)*Gamma(0,1) + (-1)^n*exp(1)*(n+1)!*Gamma(-n-1,1), where Gamma(a,x) is the upper incomplete Gamma function. - Vladimir Reshetnikov, Oct 29 2015

Extensions

Corrections and more information from Michael Somos, Feb 19 2003

A248664 Triangular array of coefficients of polynomials p(n,k) defined in Comments.

Original entry on oeis.org

1, 2, 2, 5, 12, 9, 16, 68, 112, 64, 65, 420, 1125, 1375, 625, 326, 2910, 11124, 21600, 20736, 7776, 1957, 22652, 114611, 311787, 470596, 369754, 117649, 13700, 196872, 1254976, 4455424, 9342976, 11468800, 7602176, 2097152, 109601, 1895148, 14699961, 65045025
Offset: 1

Views

Author

Clark Kimberling, Oct 11 2014

Keywords

Comments

The polynomial p(n,x) is defined as the numerator when the sum 1 + 1/(n*x + 1) + 1/((n*x + 1)(n*x + 2)) + ... + 1/((n*x + 1)(n*x + 2)...(n*x + n - 1)) is written as a fraction with denominator (n*x + 1)(n*x + 2)...(n*x + n - 1).
These polynomials occur in connection with factorials of numbers of the form [n/k] = floor(n/k); e.g., Sum_{n >= 0} ([n/k]!^k)/n! = Sum_{n >= 0} (n!^k)*p(k,n)/(k*n + k - 1)!.

Examples

			The first six polynomials:
p(1,x) = 1
p(2,x) = 2 (1 + x)
p(3,x) = 5 + 12 x + 9x^2
p(4,x) = 4 (4 + 17 x + 28 x^2 + 16 x^3)
p(5,x) = 5 (13 + 84 x + 225 x^2 + 275 x^3 + 125 x^4)
p(6,x) = 2 (163 + 1455 x + 5562 x^2 + 10800 x^3 + 10368 x^4 + 3888 x^5)
First six rows of the triangle:
1
2     2
5     12     9
16    68    112    64
65    420   1125   1375    625
326   2910  11124  21600   20736   7776
		

Crossrefs

Programs

  • Mathematica
    t[x_, n_, k_] := t[x, n, k] = Product[n*x + n - i, {i, 1, k}];
    p[x_, n_] := Sum[t[x, n, k], {k, 0, n - 1}];
    TableForm[Table[Factor[p[x, n]], {n, 1, 6}]]
    c[n_] := c[n] = CoefficientList[p[x, n], x];
    TableForm[Table[c[n], {n, 1, 10}]]  (* A248664 array *)
    Flatten[Table[c[n], {n, 1, 10}]] (* A248664 sequence *)
    u = Table[Apply[GCD, c[n]], {n, 1, 60}] (* A248666 *)
    Flatten[Position[u, 1]]  (* A248667 *)
    Table[Apply[Plus, c[n]], {n, 1, 60}]    (* A248668 *)
    Table[p[x, n] /. x -> -1, {n, 1, 30}] (* A153229 signed *)

A136580 Row sums of triangle A136579.

Original entry on oeis.org

1, 1, 3, 7, 27, 127, 747, 5167, 41067, 368047, 3669867, 40284847, 482671467, 6267305647, 87660962667, 1313941673647, 21010450850667, 357001369769647, 6423384156578667, 122002101778601647, 2439325392333218667
Offset: 0

Views

Author

Gary W. Adamson, Jan 09 2008

Keywords

Examples

			a(4) = 27 = sum of row 4 terms, triangle A136579: (1 + 0 + 2 + 0 + 24) = 0! + 2! + 4!.
a(5) = 127 = sum of row 5 terms, triangle A136579: (0 + 1 + 0 + 6 + 0 + 120) = 1! + 3! + 5!
G.f. = 1 + x + 3*x^2 + 7*x^3 + 27*x^4 + 127*x^5 + 747*x^6 + 5167*x^7 + 41067*x^8 + ...
		

Crossrefs

Programs

  • Maple
    A136580 := proc(n)
        add( (n-2*i)!,i=0..floor(n/2) ) ;
    end proc: # R. J. Mathar, Jun 04 2021
  • Mathematica
    a[0] = 1; a[1] = 1; a[2] = 3; a[n_] := a[n] = n a[n-1] + a[n-2] - n a[n-3]; Table[a[n], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 29 2015 *)

Formula

G.f.: 2/(1-x^2)/G(0), where G(k)= 1 + 1/(1 - 1/(1 - 1/(2*x*(k+1)) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 29 2013
G.f.: Q(0)/(1-x^2), where Q(k) = 1 - x*(k+1)/( x*(k+1) - 1/(1 - x*(k+1)/( x*(k+1) - 1/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Oct 22 2013
From Vladimir Reshetnikov, Oct 29 2015: (Start):
a(n) = (-1)^n*exp(1)*Gamma(0, 1)/2 - Re(Gamma(0, -1))*exp(-1)/2 + (n+2)!*((-1)^n*Re(Gamma(-n-2, -1))*exp(-1)-Gamma(-n-2, 1)*exp(1))/2, where Gamma(a, x) is the upper incomplete Gamma function.
D-finite with recurrence: a(0) = 1, a(1) = 1, a(2) = 3, a(n) = n*a(n-1) + a(n-2) - n*a(n-3).
E.g.f.: 1/(1-x) + (exp(x-1)*(Ei(1)-Ei(1-x)) + exp(1-x)*(Ei(x-1)-Ei(-1)))/2, where Ei(x) is the exponential integral.
a(n+1)-a(n) = A153229(n+2) = (-1)^(n+1)*A058006(n+1).
(End)
0 = a(n)*(+a(n+1) - a(n+2) - a(n+3) + a(n+4)) + a(n+1)*(+a(n+1) - a(n+2) - 2*a(n+3)) + a(n+2)*(+a(n+2) + a(n+3) - a(n+4)) + a(n+3)*(+a(n+3)) for all n>=0. - Michael Somos, Oct 29 2015

A303697 Number T(n,k) of permutations p of [n] whose difference between sum of up-jumps and sum of down-jumps equals k; triangle T(n,k), n>=0, min(0,1-n)<=k<=max(0,n-1), read by rows.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 4, 5, 4, 5, 4, 1, 1, 11, 19, 19, 20, 19, 19, 11, 1, 1, 26, 82, 100, 101, 100, 101, 100, 82, 26, 1, 1, 57, 334, 580, 619, 619, 620, 619, 619, 580, 334, 57, 1, 1, 120, 1255, 3394, 4339, 4420, 4421, 4420, 4421, 4420, 4339, 3394, 1255, 120, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 28 2018

Keywords

Comments

An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.

Examples

			Triangle T(n,k) begins:
:                               1                             ;
:                               1                             ;
:                          1,   0,   1                        ;
:                     1,   1,   2,   1,   1                   ;
:                1,   4,   5,   4,   5,   4,   1              ;
:           1,  11,  19,  19,  20,  19,  19,  11,   1         ;
:      1,  26,  82, 100, 101, 100, 101, 100,  82,  26,  1     ;
:  1, 57, 334, 580, 619, 619, 620, 619, 619, 580, 334, 57, 1  ;
		

Crossrefs

Programs

  • Maple
    b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
          add(b(u-j, o+j-1)*x^(-j), j=1..u)+
          add(b(u+j-1, o-j)*x^( j), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(
            `if`(n=0, 1, add(b(j-1, n-j), j=1..n))):
    seq(T(n), n=0..12);
  • Mathematica
    b[u_, o_] := b[u, o] = Expand[If[u+o == 0, 1,
         Sum[b[u-j, o+j-1] x^-j, {j, 1, u}] +
         Sum[b[u+j-1, o-j] x^j, {j, 1, o}]]];
    T[0] = {1};
    T[n_] := x^n Sum[b[j-1, n-j], {j, 1, n}] // CoefficientList[#, x]& // Rest;
    T /@ Range[0, 12] // Flatten (* Jean-François Alcover, Feb 20 2021, after Alois P. Heinz *)

Formula

T(n,0) = A153229(n) for n > 0.
T(n,1) = A005165(n-1) for n > 0.
T(n+1,n-1) = A000295(n).
T(n,k) = T(n,-k).
Sum_{k=0..n-1} k^2 * T(n,k) = A001720(n+2) for n>1.

A232845 a(0) = 0, a(1) = 1, and for n>=2, a(n) = (n-2)*a(n-1) - (n-1)*a(n-2).

Original entry on oeis.org

0, 1, 0, -2, -4, -4, 4, 44, 236, 1300, 8276, 61484, 523804, 5024036, 53478980, 624890236, 7946278604, 109195935284, 1612048228276, 25439293045580, 427278358483196, 7609502950269124, 143217213477235364, 2840152418116021916, 59189357288576068780
Offset: 0

Views

Author

Philippe Deléham, Nov 30 2013

Keywords

Examples

			a(8) = 6*44 - 7*4 = 236.
		

Crossrefs

Programs

  • Maple
    f:= gfun:-rectoproc({a(n)=(n-2)*a(n-1)-(n-1)*a(n-2),a(0)=0,a(1)=1},a(n), remember):
    map(f, [$0..30]); # Robert Israel, Jan 08 2018
    # Alternative:
    C := proc(n, x) option remember; if n > 0 then (x-n)*C(n-1, x)-n*C(n-2, x)
    elif n = 0 then 1 else 0 fi end: A232845 := n -> (-1)^(n+1)*C(n-1, 1):
    seq(A232845(n), n=0..24); # Peter Luschny, Nov 28 2018
  • Mathematica
    Flatten[{0,RecurrenceTable[{(-1+n) a[-2+n]+(2-n) a[-1+n]+a[n]==0, a[1]==1,a[2]==0}, a, {n, 20}]}] (* Vaclav Kotesovec, Jan 20 2014 *)
    nxt[{n_,a_,b_}]:={n+1,b,b(n-1)-a*n}; NestList[nxt,{1,0,1},30][[;;,2]] (* Harvey P. Dale, Jun 10 2024 *)

Formula

a(n) ~ (n-3)!. - Vaclav Kotesovec, Jan 20 2014
E.g.f.: (1-x)^2*exp(x-1)*(Ei(1)-Ei(1-x))/2 -(1-x)^2*exp(x) - x/2 + 1. - Robert Israel, Jan 08 2018
a(n) = (-1)^(n+1)*C(n-1, 1) where C(n, x) are the Charlier polynomials (with parameter a=1) as given in A137338. (Evaluation at x = -1 gives the left factorials A003422.) - Peter Luschny, Nov 28 2018

A260612 Triangle read by rows: T(n,k) = coefficient of x^(n-k) in Product_{m=0..n-1} (x+(-1)^m*m!), 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 0, -1, 1, 2, -1, -2, 1, -4, -13, 4, 12, 1, 20, -109, -308, 108, 288, 1, -100, -2509, 12772, 37068, -12672, -34560, 1, 620, -74509, -1793708, 9232908, 26676288, -9158400, -24883200, 1, -4420, -3199309, 373731652, 9049521228, -46507180032, -134457649920, 46133452800, 125411328000
Offset: 0

Views

Author

Matthew Campbell, Aug 08 2015

Keywords

Examples

			Row 0: 1.
Row 1: (x+(-1)^(0)*0!) = x+1. Coefficients are 1 and 1.
Row 2: (x+(-1)^0*0!)*(x+(-1)^(1)*1!) = (x+1)*(x-1) = x^2-1. Coefficients are 1, 0, and -1.
Row 3: (x+(-1)^(0)*0!)*(x-(-1)^(1)*1!)*(x+(-1)^(2)*2!) = (x+1)*(x-1)*(x+2) = x^3 + 2*x^2 - x - 2. Coefficients are 1, 2, -1, and -2.
		

Crossrefs

Formula

T(n, 1) = A058006(n-1) = (-1)^(n+1)*A153229(n) for n >= 1.

A385301 a(n) = Sum_{k=0..p-1} 1/k! mod p where p is prime(n) and 1/k! is the inverse of k! modulo p.

Original entry on oeis.org

0, 1, 0, 3, 6, 0, 8, 4, 4, 9, 21, 0, 39, 37, 40, 32, 26, 12, 61, 6, 57, 74, 21, 41, 39, 60, 86, 64, 4, 27, 55, 2, 63, 113, 29, 42, 150, 97, 33, 84, 100, 120, 184, 72, 1, 134, 100, 78, 145, 8, 199, 98, 65, 25, 104, 95, 153, 207, 90, 132, 67, 132, 301, 251, 293, 185, 168, 176, 120, 297
Offset: 1

Views

Author

Paras Dhanuka, Jun 24 2025

Keywords

Examples

			a(1) = Sum_(k=0..2 - 1) (k!)^(2 - 2) mod 2 = 0.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k; p:= ithprime(n); add(1/k!, k=1..p-1) mod p end proc:
    map(f, [$1..100]); # Robert Israel, Jul 01 2025
  • Mathematica
    a[n_] := Module[{p = Prime[n]}, Mod[Sum[PowerMod[k!, p-2, p], {k, 0, p-1}], p]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 26 2025 *)
  • PARI
    a(n) = sum(k=0, prime(n) - 1, (k!)^(prime(n) - 2)) % prime(n); \\ Michel Marcus, Jun 25 2025
    
  • Python
    from sympy import prime
    def a(n):
       p = prime(n)
       s = invfact = 1
       for i in range(1, p):
           invfact = (invfact * pow(i, -1, p)) % p
           s += invfact
       return s % p # David Radcliffe, Jun 25 2025

Formula

a(n) = Sum_{k=0..prime(n) - 1} (k!)^(prime(n) - 2) mod prime(n) where prime(n) is the n-th prime.
a(n) = A153229(p) mod p, where p = prime(n). - David Radcliffe, Jun 26 2025

Extensions

More terms from Michel Marcus, Jun 25 2025
Showing 1-10 of 11 results. Next