login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A003422 Left factorials: !n = Sum_{k=0..n-1} k!.
(Formerly M1237)
119

%I M1237 #272 Mar 05 2024 16:47:02

%S 0,1,2,4,10,34,154,874,5914,46234,409114,4037914,43954714,522956314,

%T 6749977114,93928268314,1401602636314,22324392524314,378011820620314,

%U 6780385526348314,128425485935180314,2561327494111820314,53652269665821260314,1177652997443428940314

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

%C Number of {12, 12*, 1*2, 21*}- and {12, 12*, 21, 21*}-avoiding signed permutations in the hyperoctahedral group.

%C 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

%C 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

%C 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

%C 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

%C 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

%C Additive version of the superfactorials A000178. - _Jon Perry_, Feb 09 2013

%C Repunits in the factorial number system (see links). - _Jon Perry_, Feb 17 2013

%C 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.

%C !n is not always squarefree for n > 3. Miodrag Zivkovic found that 54503^2 divides !26541. - _Arkadiusz Wesolowski_, Nov 20 2013

%C a(n) gives the position of A007489(n) in A227157. - _Antti Karttunen_, Nov 29 2013

%C Matches the total domination number of the Bruhat graph from n = 2 to at least n = 5. - _Eric W. Weisstein_, Jan 11 2019

%C 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

%D Richard K. Guy, Unsolved Problems Number Theory, Section B44.

%D D. Kurepa, On the left factorial function !n. Math. Balkanica 1 1971 147-153.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H T. D. Noe, <a href="/A003422/b003422.txt">Table of n, a(n) for n = 0..100</a>

%H P. J. Cameron, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL3/groups.html">Sequences realized by oligomorphic permutation groups</a>, J. Integ. Seqs. Vol. 3 (2000), Article 00.1.5.

%H Bernd C. Kellner, <a href="https://arxiv.org/abs/math/0410477">Some remarks on Kurepa's left factorial</a>, arXiv:math/0410477 [math.NT], 2004.

%H D. Kurepa, <a href="/A003422/a003422_1.pdf">On the left factorial function !N</a>, Math. Balkanica 1 (1971), 147-153. (Annotated scanned copy).

%H T. Mansour and J. West, <a href="http://arXiv.org/abs/math.CO/0207204">Avoiding 2-letter signed patterns</a>, arXiv:math/0207204 [math.CO], 2002.

%H Romeo Meštrović, <a href="http://arxiv.org/abs/1312.7037">Variations of Kurepa's left factorial hypothesis</a>, arXiv preprint arXiv:1312.7037 [math.NT], 2013.

%H Romeo Meštrović, <a href="https://doi.org/10.2298/FIL1510207M">The Kurepa-Vandermonde matrices arising from Kurepa's left factorial hypothesis</a>, Filomat 29:10 (2015), 2207-2215; DOI 10.2298/FIL1510207M.

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha103.htm">Factorizations of many number sequences</a>.

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha131.htm">Factorizations of many number sequences</a>

%H F. J. Papp, <a href="/A003422/a003422.pdf">Letter to N. J. A. Sloane, Nov 1974</a>.

%H Jon Perry, <a href="http://www.users.globalnet.co.uk/~perry/maths/sumoffactorials/sumoffactorials.htm">Sum of Factorials</a>. [Broken link?]

%H Aleksandar Petojevic, <a href="http://elib.mi.sanu.ac.rs/files/journals/flmt/12/flmn12p29-37.pdf">On Kurepa's hypothesis for the left factorial</a>, Filomat, Vol. 12, No. 1, 1998.

%H Alexsandar Petojevic, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL5/Petojevic/petojevic5.html">The Function vM_m(s; a; z) and Some Well-Known Sequences</a>, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7.

%H Aleksandar Petojevic, <a href="https://doi.org/10.1216/rmjm/1181069388">The {K_i(z)}_{i=1..oo} functions</a>, Rocky Mtn. J. Math., 36 (2006), 1637-1650.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/FactorialSums.html">Factorial Sums</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LeftFactorial.html">Left Factorial</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Repunit.html">Repunit</a>.

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Factorial_number_system">Factorial number system</a>.

%H Miodrag Zivkovic, <a href="http://dx.doi.org/10.1090/S0025-5718-99-00990-4">The number of primes sum_{i=1..n} (-1)^(n-i)*i! is finite</a>, Math. Comp. 68 (1999), pp. 403-409.

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>.

%F D-finite with recurrence: a(n) = n*a(n - 1) - (n - 1)*a(n - 2). - _Henry Bottomley_, Feb 28 2001

%F Sequence is given by 1 + 1*(1 + 2*(1 + 3*(1 + 4*(1 + ..., terminating in n*(1)...). - _Jon Perry_, Jun 01 2004

%F a(n) = Sum_{k=0..n-1} P(n, k) / C(n, k). - _Ross La Haye_, Sep 20 2004

%F 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

%F a(n) = Integral_{x = 0..oo} [(x^n - 1)/(x - 1)]*exp(-x) dx. - _Gerald McGarvey_, Oct 12 2007

%F A007489(n) = !(n + 1) - 1 = a(n + 1) - 1. - _Artur Jasinski_, Nov 08 2007. Typos corrected by _Antti Karttunen_, Nov 29 2013

%F Starting (1, 2, 4, 10, 34, 154, ...), = row sums of triangle A135722. - _Gary W. Adamson_, Nov 25 2007

%F a(n) = a(n - 1) + (n - 1)! for n >= 2. - _Jaroslav Krizek_, Jun 16 2009

%F E.g.f. A(x) satisfies the differential equation A'(x) = A(x) + 1/(1 - x). - _Vladimir Kruchinin_, Jan 19 2011

%F 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

%F From _Sergei N. Gladkovskii_, May 09 2013 to Oct 22 2013: (Start)

%F Continued fractions:

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

%F G.f.: G(0)*x/(1-x)/2 where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + 1/G(k+1))).

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

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

%F G.f.: B(x)*(1+x)/(1-x) where B(x) is the g.f. of A153229.

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

%F G.f.: x*(1+x)*B(x) where B(x) is the g.f. of A136580. (End)

%F 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

%F a(n) = (a(n-3)*(n-2)^2*(n-3)! + a(n-1)^2)/a(n-2) (empirical). - _Gary Detlefs_, Feb 25 2022

%F a(n) = signum(n)/b(1,n) with b(i,n) = i - [i<n] * i/b(i+1,n). - _Mohammed Bouras_, Sep 07 2022

%F Sum_{n>=1} 1/a(n) = A357145. - _Amiram Eldar_, Oct 01 2022

%e !5 = 0! + 1! + 2! + 3! + 4! = 1 + 1 + 2 + 6 + 24 = 34.

%e 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 + ...

%e From _Arkadiusz Wesolowski_, Aug 06 2012: (Start)

%e Illustration of initial terms:

%e .

%e . o o o o o

%e . o o o o

%e . o o o o o o

%e . ooo ooo ooo ooo

%e . oooo oooo oooo oooo oooo oooo

%e .

%e . 1 2 4 10 34

%e .

%e (End)

%e The tree graph. The total number of vertices at each stage is 1, 2, 4, 10, ...

%e 0 0

%e |/

%e 0-0

%e /

%e 0-0

%e \

%e 0-0

%e |\

%e 0 0

%e - _Jon Perry_, Jan 27 2013

%p A003422 := proc(n) local k; add(k!,k=0..n-1); end proc:

%p # Alternative, using the Charlier polynomials A137338:

%p C := proc(n, x) option remember; if n > 0 then (x-n)*C(n-1, x) - n*C(n-2, x)

%p elif n = 0 then 1 else 0 fi end: A003422 := n -> (-1)^(n+1)*C(n-1, -1):

%p seq(A003422(n), n=0..22); # _Peter Luschny_, Nov 28 2018

%p # third Maple program:

%p a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+(n-1)!) end:

%p seq(a(n), n=0..23); # _Alois P. Heinz_, Feb 24 2022

%t Table[Sum[i!, {i, 0, n - 1}], {n, 0, 20}] (* _Stefan Steinerberger_, Mar 31 2006 *)

%t Join[{0}, Accumulate[Range[0, 25]!]] (* _Harvey P. Dale_, Nov 19 2011 *)

%t 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 *)

%t a[n_] := (-1)^n*n!*Subfactorial[-n-1]-Subfactorial[-1]; Table[a[n] // FullSimplify, {n, 0, 22}] (* _Jean-François Alcover_, Jan 09 2014 *)

%t 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 *)

%t Range[0, 20]! CoefficientList[Series[(ExpIntegralEi[1] - ExpIntegralEi[1 - x]) Exp[x - 1], {x, 0, 20}], x] (* _Eric W. Weisstein_, Jan 11 2019 *)

%t Table[(-1)^n n! Subfactorial[-n - 1] - Subfactorial[-1], {n, 0, 20}] // FullSimplify (* _Eric W. Weisstein_, Jan 11 2019 *)

%t Table[(I Pi + ExpIntegralEi[1] + (-1)^n n! Gamma[-n, -1])/E, {n, 0, 20}] // FullSimplify (* _Eric W. Weisstein_, Jan 11 2019 *)

%o (PARI) a003422(n)=sum(k=0,n-1,k!) \\ _Charles R Greathouse IV_, Jun 15 2011

%o (Haskell)

%o a003422 n = a003422_list !! n

%o a003422_list = scanl (+) 0 a000142_list

%o -- _Reinhard Zumkeller_, Dec 27 2011

%o (Maxima) makelist(sum(k!,k,0,n-1), n, 0, 20); /* _Stefano Spezia_, Jan 11 2019 */

%o (Python)

%o from itertools import count, islice

%o def A003422_gen(): # generator of terms

%o yield from (0,1)

%o c, f = 1, 1

%o for n in count(1):

%o yield (c:= c + (f:= f*n))

%o A003422_list = list(islice(A003422_gen(),20)) # _Chai Wah Wu_, Jun 22 2022

%o (Python)

%o def a(n):

%o if n == 0: return 0

%o s = f = 1

%o for k in range(1, n):

%o f *= k

%o s += f

%o return round(s)

%o print([a(n) for n in range(24)]) # _Peter Luschny_, Mar 05 2024

%Y Equals A007489(n-1)+1 for n>=1. Cf. A000142, A014144, A005165.

%Y Twice A014288. See also A049782, A100612.

%Y Cf. A102639, A102411, A102412, A101752, A094216, A094638, A008276, A000166, A000110, A000204, A000045, A000108, A135722, A227157, A000178, A137338, A232845, A357145.

%K nonn,easy,nice

%O 0,3

%A _N. J. A. Sloane_, _R. K. Guy_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 23:54 EDT 2024. Contains 372178 sequences. (Running on oeis4.)