Date: Wed, 15 Nov 95 13:29:42 CST From: rusin (Dave Rusin) To: tony@mantis.co.uk Subject: Re: Sub-factorial Newsgroups: sci.math In article <48cp0a$lge@sunforest.mantis.co.uk> you write: > Subfactorial n = n!*[1 - (1/1!) + (1/2!) - (1/3!) + (1/4!) ... (1/n!)] > >And no-one's come up with a nice (=satisfies the recurrence relation >which escapes me at the moment and perhaps log-convex) extension of >this to the reals. Anyone? Never thought about it before, but clearly SF(n)=n!*(1/e) +- (1/(n+1)-1/((n+1)(n+2)+... so we could use SF(x)=Gamma(x+1)/e + sin(pi x)*Sum( (-1)^k/[(x+1)...(x+k)] ); the sum converges except at negative integers by the ratio test. Surely this rather natural looking sum is related to one of the other known special functions. dave ============================================================================== From: tony@mantis.co.uk (Tony Lezard) Subject: Re: Sub-factorial To: rusin@math.niu.edu (Dave Rusin) Date: Thu, 16 Nov 1995 11:54:26 +0000 (GMT) You wrote: > Never thought about it before, but clearly > SF(n)=n!*(1/e) +- (1/(n+1)-1/((n+1)(n+2)+... > so we could use SF(x)=Gamma(x+1)/e + sin(pi x)*Sum( (-1)^k/[(x+1)...(x+k)] ); > the sum converges except at negative integers by the ratio test. Surely > this rather natural looking sum is related to one of the other known > special functions. Well it looks just like the sum for the partial expansion of exp(-1) which is more or less what we were trying to find, so I would be pessimistic of this working. My guess is that the approach used to derive the Gamma function is the best bet. Recall that from (a) Gamma(n+1) = n.Gamma(n), (b) Gamma(1)=1, (c) Gamma is log-convex we can obtain Gauss' (I think) form of the Gamma function and thence all the rest of it. Similarly, we can define SubGamma(n) = !(n-1) and replace relation (a) above with SubGamma(n+1) = n.SubGamma(n) + (-1)^n and leave the other two properties intact. The problem then becomes one of suitably generalising the (-1)^n bit. It's hard. You can't just take powers of -1 because we also want this thing to be real for positive real argument. One trick that can deal with this in other areas is to apply the recursion twice and hope the -1s cancel out but regrettably all you get is SubGamma(n+2) = (n+1).n.SubGamma(n) + n.(-1)^n. Maybe if you iterate it some more you get a pattern, but I've done it a couple more times and the (-1)^n term just gets uglier and uglier. I'm stumped. -- == Tony Lezard == | PGP public key 0xBF172045 available from keyservers tony@mantis.co.uk | or from my home page, http://www.mantis.co.uk/~tony/ ============================================================================== Date: Fri, 17 Nov 95 12:31:24 CST From: rusin (Dave Rusin) To: tony@mantis.co.uk Subject: Re: Sub-factorial Just an added idea: I passed the sum to Mathematica with this outcome: Mathematica 2.2 for SPARC Copyright 1988-93 Wolfram Research, Inc. -- Terminal graphics initialized -- In[1]:= Needs["Algebra`SymbolicSum`"] In[2]:= Evaluate[SymbolicSum[(-1)^k/Factorial[k], {k, 0, n}]] n Gamma[2 + n] + (-1) E Hypergeometric1F1[1, 2 + n, -1] Out[2]= ------------------------------------------------------ E Gamma[2 + n] So apart from the use of the Gamma function, I guess what you want to do is use the hypergeometric function 1F1(1,x,-1) (toss in a cos(n*Pi) instead of (-1)^n). I'm not a "special functions" kind of guy, but I would imagine there's substantial literature on these things, in particular information which would attest to their analyticity. (I hope so anyway, because the formula used to define these functions is really just the kind of sum I wrote in my last message to you -- 1+1/x+1/((x)(x+1)) etc. or something. One has to hope that, like the gamma function, these things take on a life of their own in the complex plane.) It may well be that in the literature you will find the kind of recursion formula for these functions which resembles the one for the subfactorials. dave PS, Here's the definition from Maple: |\^/| Maple V Release 3 (N I U) ._|\| |/|_. Copyright (c) 1981-1994 by Waterloo Maple Software and the \ MAPLE / University of Waterloo. All rights reserved. Maple and Maple V <____ ____> are registered trademarks of Waterloo Maple Software. | Type ? for help. > ?hypergeom ?hypergeom FUNCTION: hypergeom - generalized hypergeometric function CALLING SEQUENCE: hypergeom([n1, n2, ... ], [d1, d2, ... ], z) PARAMETERS: [n1, n2, ... ] - list of numerator coefficients [d1, d2, ... ] - list of denominator coefficients SYNOPSIS: - The function hypergeom(n, d, z) is the generalized hypergeometric function F(n, d, z). This function is also known as Barnes's extended hypergeometric function. If there are j coefficients in n, and k coefficients in d, this function is also known as jFk. - The definition of F(n, d, z) is sum ( (product( GAMMA( n[i]+k ) / GAMMA( n[i] ), i=1..j)*z^k ) / (product( GAMMA( d[i]+k ) / GAMMA (d[i] ), i=1..m)*k! ), k=0..infinity) where j is the number of terms in the list [n1, n2, ... ] and m is the number of terms in the list [d1, d2, ...]. - If n[i] = -m, a non-positive integer, the series stops after m terms. - This function should be defined by the command readlib(hypergeom) before it is used. EXAMPLES: > readlib(hypergeom): > hypergeom( [],[],z ); exp(z) > hypergeom( [a],[],z ); (- a) (1 - z) > hypergeom( [1,2],[2,3],z ); exp(z) - 1 - z 2 -------------- 2 z SEE ALSO: convert, inifcns