主題
Search

階乘


階乘 n! 對於正整數 n 定義為

 n!=n(n-1)...2·1.
(1)

因此,例如,4!=4·3·2·1=24。較舊的階乘記號寫作 FactorialOld (Mellin 1909; Lewin 1958, p. 19; Dudeney 1970; Gardner 1978; Conway and Guy 1996)。

特殊情況 0! 被定義為值 0!=1,這與恰好一個排列零個物件的組合解釋一致(即,零個元素的排列只有一個,即空集 emptyset)。

階乘在 Wolfram 語言中實現為階乘[n] 或 n!。

三角形數 T_n=n+(n-1)+...+2+1 可以被看作是階乘 n!=n·(n-1)...2·1 的加法模擬。階乘和三角形數之間的另一個關係由以下恆等式給出

 (2n)!=2^nproduct_(k=1)^nT_(2k-1)
(2)

(K. MacMillan,私人通訊,1 月 21 日,2008 年)。

階乘 n! 給出了 n 個物件可以排列的方式的數量。例如,3!=6,因為 {1,2,3} 的六種可能的排列是 {1,2,3}{1,3,2}{2,1,3}{2,3,1}{3,1,2}{3,2,1}。對於 n=0、1、2、...,前幾個階乘是 1、1、2、6、24、120、... (OEIS A000142)。

對於 n=0、1、...,(10^n)! 中的位數是 1、7、158、2568、35660、456574、5565709、65657060、... (OEIS A061010)。

可以定義階乘的推廣,例如雙階乘 n!!多階乘 n!...!_()_(k)。但是請注意,這些等於巢狀階乘 (n!)!((n!)!)! 等。

對於 n=1、2、...,(n!)! 的前幾個值是 1、2、720、620448401733239439360000、... (Eureka 1974; OEIS A000197)。(n!)! 中的位數是 1、1、3、24、199、1747、... (OEIS A063979)。

n 變大時,階乘開始出現尾隨。要計算 n! 的尾隨的數量 Z,請使用

 Z=sum_(k=1)^(k_(max))|_n/(5^k)_|,
(3)

其中

 k_(max)=|_log_5n_|
(4)

|_x_|向下取整函式 (Gardner 1978, p. 63; Ogilvy and Anderson 1988, pp. 112-114)。對於 n=1、2、...,尾隨零的數量是 0、0、0、0、1、1、1、1、1、2、2、2、2、2、3、3、... (OEIS A027868)。這是勒讓德在 1808 年首次發現的一般結果的特殊應用:整除 n!素數 p 的最大

 epsilon_p(n)=sum_(k=1)^(|_log_pn_|)|_n/(p^k)_|
(5)

(Landau 1974, pp. 75-76; Honsberger 1976; Hardy and Wright 1979, pp. 342; Ribenboim 1989; Ingham 1990, p. 20; Graham et al. 1994; Vardi 1991; Hardy 1999, pp. 18 and 21; Havil 2003, p. 165; Boros and Moll 2004, p. 5)。這可以在 Wolfram 語言中實現為

  HighestPower[p_?PrimeQ, n_] :=
    Sum[Floor[n/p^k], {k, Floor[Log[p,n]]}]

換句話說,整除 n!素數 p 的精確

 (n-s_p(n))/(p-1),
(6)

其中 s_p(n)nb 進位制下的數字和 (Boros and Moll 2004, p. 6)。這可以在 Wolfram 語言中實現為

  HighestPower2[p_Integer?PrimeQ, n_] :=
    (n - Total[IntegerDigits[n, p]])/(p - 1)

因此,正如勒讓德所示,

 n!=product_(p<=n)p^(epsilon_p(n))
(7)

(Havil 2003, p. 165)。

a(n)n! 中的最後一個非零數字,則前幾個值是 2、6、4、2、2、4、2、8、8、8、6、8、... (OEIS A008904)。Kakutani (1967) 研究了這個序列,他表明這個序列是“5-自動的”,大致意思是存在一個有限自動機,當給定 n 在 5 進位制下的數字時,它將最終進入一個狀態,該狀態的輸出對映指定 a(n)。數字的精確分佈由此結果得出。

Factorial
FactorialReImAbs
最小值 最大值
實部
虛部 Powered by webMathematica

透過注意到

 n!=Gamma(n+1),
(8)

其中 Gamma(n)伽瑪函式,對於整數 n,定義可以推廣到數值

 z!=Gamma(z+1)=int_0^inftye^(-t)t^zdt.
(9)

這定義了所有數值 zz!,除非 n負整數,在這種情況下,n! 等於復無窮大

雖然高斯 (G1) 引入了記號

 Pi(s)=Gamma(s+1),
(10)

但在勒讓德引入伽瑪記號後,此記號隨後被棄用 (Edwards 2001, p. 8)。

使用伽瑪函式的恆等式,(1/2n)!(半整數值)的值可以顯式寫出

(-1/2)!=sqrt(pi)
(11)
(1/2)!=1/2sqrt(pi)
(12)
(n-1/2)!=(sqrt(pi))/(2^n)(2n-1)!!
(13)
(n+1/2)!=(sqrt(pi))/(2^(n+1))(2n+1)!!,
(14)

其中 n!!雙階乘

對於整數 sn,且 s<n,

 ((s-n)!)/((2s-2n)!)=((-1)^(n-s)(2n-2s)!)/((n-s)!).
(15)

z!對數經常遇到

ln(z!)=1/2ln[(piz)/(sin(piz))]-gammaz-sum_(n=1)^(infty)(zeta(2n+1))/(2n+1)z^(2n+1)
(16)
=1/2ln[(piz)/(sin(piz))]-1/2ln((1+z)/(1-z))+(1-gamma)z-sum_(n=1)^(infty)[zeta(2n+1)-1](z^(2n+1))/(2n+1)
(17)
=sum_(n=1)^(infty)(z^n)/(n!)psi_(n-1)(1)
(18)
=-gammaz+sum_(n=2)^(infty)(-1)^n(z^n)/nzeta(n)
(19)
=-ln(1+z)+z(1-gamma)+sum_(n=2)^(infty)(-1)^n[zeta(n)-1](z^n)/n,
(20)

其中 gamma尤拉-馬歇羅尼常數zeta(z)黎曼 zeta 函式,而 psi_n(z)多伽瑪函式

它也由極限給出

ln(z!)=ln[lim_(n->infty)(zn!)/((z)_(n+1))n^z]
(21)
=ln[lim_(n->infty)(n!)/((z+1)_n)n^z]
(22)
=ln[lim_(n->infty)(n!)/((z+1)(z+2)...(z+n))n^z]
(23)
=lim_(n->infty)[ln(n!)+zlnn-ln(z+1)-ln(z+2)-...-ln(z+n)],
(24)

其中 (z)_n波赫哈默爾符號

其中 gamma尤拉-馬歇羅尼常數zeta(z)黎曼 zeta 函式,而 psi_n(z)多伽瑪函式。階乘可以展開為級數

 z!=sqrt(2pi)z^(z+1/2)e^(-z)(1+1/(12)z^(-1)+1/(288)z^(-2)-(139)/(51840)z^(-3)+...)
(25)

(OEIS A001163A001164)。斯特林級數給出了 ln(z!) 的級數展開

ln(z!)=1/2ln(2pi)+(z+1/2)lnz-z+(B_2)/(2z)+...+(B_(2n))/(2n(2n-1)z^(2n-1))+...
(26)
=1/2ln(2pi)+(z+1/2)lnz-z+1/(12)z^(-1)-1/(360)z^(-3)+1/(1260)z^(-5)-...
(27)

(OEIS A046968A046969),其中 B_n伯努利數

一般來說,冪乘積序列 (Mudge 1997) 由 S_k^+/-(n)=(n!)^k+/-1 給出。S_2^+(n) 的前幾項是 2、5、37、577、14401、518401、... (OEIS A020549),並且對於 n=1、2、3、4、5、9、10、11、13、24、65、76、...,S_2^+(n)素數 (OEIS A046029)。S_2^-(n) 的前幾項是 0、3、35、575、14399、518399、... (OEIS A046032),但 S_2^-(n) 僅對於 n=2素數,因為對於 n>2S_2^-(n)=(n!)^2-1=(n!+1)(n!-1)S_3^-(n) 的前幾項是 0、7、215、13823、1727999、... (OEIS A046033),而 S_3^+(n) 的前幾項是 2、9、217、13825、1728001、... (OEIS A019514)。

前幾個數 n,使得其數字的階乘之和等於素數計數函式 pi(n) 是 6500、6501、6510、6511、6521、12066、50372、... (OEIS A049529)。此序列是有限的,最大項是 a_(23)=11071599

滿足以下條件的數 n 被稱為威爾遜素數

 (n-1)!+1=0 (mod n^2),
(28)

被稱為威爾遜素數

布朗數是滿足布羅卡爾問題條件的整數(m,n),即滿足

 n!+1=m^2.
(29)

僅已知三對這樣的數:(5, 4), (11, 5), (71, 7)。Erdős 猜想這僅有的三個這樣的對 (Guy 1994, p. 193)。


另請參閱

Alladi-Grinstead 常數, 交錯階乘, 布羅卡爾問題, 布朗數, 中心階乘, 雙階乘, 階乘素數, 階乘積, 階乘和, Factorion, 降階乘, Fibonorial, 伽瑪函式, 超階乘, Legions 數, Leviathan 數, 多階乘, 波赫哈默爾符號, 素數階乘, 升階乘, 羅馬階乘, 斯特林級數, 次階乘, 超超階乘, 威爾遜素數 在 課堂中探索此主題

相關 Wolfram 網站

http://functions.wolfram.com/GammaBetaErf/Factorial/

使用 探索

參考文獻

Boros, G. 和 Moll, V. Irresistible Integrals: Symbolics, Analysis and Experiments in the Evaluation of Integrals. Cambridge, England: Cambridge University Press, 2004.Caldwell, C. K. "The Top Twenty: Primorial and Factorial Primes." http://www.utm.edu/research/primes/lists/top20/PrimorialFactorial.html.Conway, J. H. 和 Guy, R. K. "Factorial Numbers." 在 The Book of Numbers. New York: Springer-Verlag, pp. 65-66, 1996.Dudeney, H. E. Amusements in Mathematics. New York: Dover, p. 96, 1970.Edwards, H. M. "The Factorial Function." §in 1.3 Riemann's Zeta Function. New York: Dover, pp. 7-9, 2001.Gardner, M. "Factorial Oddities." Ch. 4 在 Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, pp. 50-65, 1978.Gauss, C. F. "Disquisitiones Generales Circa Seriem Infinitam [(alphabeta)/(1·gamma)]x+[(alpha(alpha+1)beta(beta+1))/(1·2·gamma(gamma+1))]x^2 +[(alpha(alpha+1)(alpha+2)beta(beta+1)(beta+2))/(1·2·3·gamma(gamma+1)(gamma+2))]x^3+ etc. Pars Prior." Commentationes Societiones Regiae Scientiarum Gottingensis Recentiores, Vol. II. 1812. Reprinted in Gesammelte Werke, Bd. 3, pp. 123-163 和 207-229, 1866.Glynn, J. 和 Gray, T. The Beginner's Guide To Mathematica, Version 4. Cambridge, England: Cambridge University Press, 2000.Graham, R. L.; Knuth, D. E.; 和 Patashnik, O. "Factorial Factors." §4.4 在 Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, pp. 111-115, 1994.Guy, R. K. "Equal Products of Factorials," "Alternating Sums of Factorials," 和 "Equations Involving Factorial n." §B23, B43, 和 D25 在 Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 80, 100, 和 193-194, 1994.Hardy, G. H. Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, 3rd ed. New York: Chelsea, 1999.Hardy, G. H. 和 Wright, E. M. An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, 1979.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, 2003.Hoey, D. "Re: 01 squares." math-fun@cs.arizona.edu posting, May 19, 1997.Honsberger, R. Mathematical Gems II. Washington, DC: Math. Assoc. Amer., p. 2, 1976.Ingham, A. E. The Distribution of Prime Numbers. Cambridge, England: Cambridge University Press, 1990.Jeffreys, H. 和 Jeffreys, B. S. Methods of Mathematical Physics, 3rd ed. Cambridge, England: Cambridge University Press, pp. 462-463, 1988.Kakutani, S. "Ergodic Theory of Shift Transformations." 在 Proc. 5th Berkeley Symposium on Mathematical Statistics and Probability, Vol. 2. Berkeley, CA: University of California Press, pp. 405-414, 1967.Landau, E. Handbuch der Lehre von der Verteilung der Primzahlen, 3rd ed. New York: Chelsea, 1974.Lewin, L. Dilogarithms and Associated Functions. London: Macdonald, 1958.Leyland, P. http://www.leyland.vispa.com/numth/factorization/factors/factorial+.txt.Leyland, P. http://www.leyland.vispa.com/numth/factorization/factors/factorial-.txt.Madachy, J. S. Madachy's Mathematical Recreations. New York: Dover, p. 174, 1979.Mellin, H. "Abrißeiner einheitlichen Theorie der Gamma- und der hypergeometrischen Funktionen." Math. Ann. 68, 305-337, 1909.Mudge, M. "Not Numerology but Numeralogy!" Personal Computer World, 279-280, 1997.Ogilvy, C. S. 和 Anderson, J. T. Excursions in Number Theory. New York: Dover, 1988.Petkovšek, M.; Wilf, H. S.; 和 Zeilberger, D. A=B. Wellesley, MA: A K Peters, p. 86, 1996. http://www.cis.upenn.edu/~wilf/AeqB.html.Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; 和 Vetterling, W. T. "Gamma Function, Beta Function, Factorials, Binomial Coefficients." §6.1 在 Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 206-209, 1992.Ribenboim, P. The New Book of Prime Number Records. New York: Springer-Verlag, pp. 22-24, 1989.Sloane, N. J. A. 序列 A000142/M1675, A000197/M2187, A001163/M5400, A001164/M4878, A008904, A019514, A020549, A027868, A046029, A046032, A046033, A046968, A046969, A049529, A061010, 和 A063979 在 "整數序列線上百科全書" 中。Spanier, J. 和 Oldham, K. B. "The Factorial Function n! and Its Reciprocal." Ch. 2 在 An Atlas of Functions. Washington, DC: Hemisphere, pp. 19-33, 1987.Trott, M. The Mathematica GuideBook for Programming. New York: Springer-Verlag, p. 81, 2004. http://www.mathematicaguidebooks.org/.Vardi, I. Computational Recreations in Mathematica. Reading, MA: Addison-Wesley, p. 67, 1991.Vout, C. 和 Brown, M. "Problems Drive." Eureka 37, 11, 1974.

在 上被引用

階乘

請引用為

Weisstein, Eric W. "階乘。" 來自 Web 資源。 https://mathworld.tw/Factorial.html

主題分類