All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 It's e-asy (Posted on 2008-02-19)
Outline a method for calculating Sk = Σ nk/n! for n=1 to infinity and compute the first few terms of Sk for natural numbers k.

 See The Solution Submitted by FrankM Rating: 2.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 7

Hmmm....

Calculating n^k is easy enough by multiplying n by itself k times, or you could take the antilog of k*log(n). And n! is easier, as it builds on (n-1)!, so you don't even have to start from scratch with each term.

The numbers get big as n gets large, but the factorials increase so greatly compared to the powers that only a few terms are needed.

DEFDBL A-Z

FOR k = 1 TO 10
PRINT "k ="; k
t = 0
term = 1: f = 1
FOR n = 1 TO 44
f = f * n
term = n ^ k / f
t = t + term
PRINT USING "## ####.######### ####.########"; n; term; t
NEXT
PRINT k; t;
IF k = 1 THEN save = t:  ELSE PRINT INT(t / save + .5);
PRINT
DO: LOOP UNTIL INKEY\$ > ""
NEXT

Some results:

`k = 1 n      nth term    partial total  1    1.000000000    1.00000000 2    1.000000000    2.00000000 3    0.500000000    2.50000000 4    0.166666667    2.66666667 5    0.041666667    2.70833333 6    0.008333333    2.71666667 7    0.001388889    2.71805556 8    0.000198413    2.71825397 9    0.000024802    2.7182787710    0.000002756    2.7182815311    0.000000276    2.7182818012    0.000000025    2.7182818313    0.000000002    2.7182818314    0.000000000    2.71828183`

So, for k=1, it seems to converge to e.

`k = 2 1    1.000000000    1.00000000 2    2.000000000    3.00000000 3    1.500000000    4.50000000 4    0.666666667    5.16666667 5    0.208333333    5.37500000 6    0.050000000    5.42500000 7    0.009722222    5.43472222 8    0.001587302    5.43630952 9    0.000223214    5.4365327410    0.000027557    5.4365603011    0.000003031    5.4365633312    0.000000301    5.4365636313    0.000000027    5.4365636514    0.000000002    5.4365636615    0.000000000    5.43656366`

So, for k=2, it seems to converge to 2e.

`k = 3 1    1.000000000    1.00000000 2    4.000000000    5.00000000 3    4.500000000    9.50000000 4    2.666666667   12.16666667 5    1.041666667   13.20833333 6    0.300000000   13.50833333 7    0.068055556   13.57638889 8    0.012698413   13.58908730 9    0.002008929   13.5910962310    0.000275573   13.5913718011    0.000033344   13.5914051512    0.000003608   13.5914087613    0.000000353   13.5914091114    0.000000031   13.5914091415    0.000000003   13.5914091416    0.000000000   13.59140914`

At k=3, we now have 5e.

`k = 4 1    1.000000000    1.00000000 2    8.000000000    9.00000000 3   13.500000000   22.50000000 4   10.666666667   33.16666667 5    5.208333333   38.37500000 6    1.800000000   40.17500000 7    0.476388889   40.65138889 8    0.101587302   40.75297619 9    0.018080357   40.7710565510    0.002755732   40.7738122811    0.000366788   40.7741790712    0.000043290   40.7742223613    0.000004587   40.7742269414    0.000000441   40.7742273815    0.000000039   40.7742274216    0.000000003   40.7742274317    0.000000000   40.77422743`

Now, at k=4, it seems we have 15e. There go our hopes of getting some sequence of Fibonacci multiples of e.

`k = 5 1    1.000000000    1.00000000 2   16.000000000   17.00000000 3   40.500000000   57.50000000 4   42.666666667  100.16666667 5   26.041666667  126.20833333 6   10.800000000  137.00833333 7    3.334722222  140.34305556 8    0.812698413  141.15575397 9    0.162723214  141.3184771810    0.027557319  141.3460345011    0.004034667  141.3500691712    0.000519481  141.3505886513    0.000059626  141.3506482814    0.000006169  141.3506544415    0.000000581  141.3506550316    0.000000050  141.3506550817    0.000000004  141.3506550818    0.000000000  141.35065508`

The total is 52e.

Cutting to the chase, commenting out the individual terms, and getting the final results of each k:

` k       sum            multiple of e 1  2.718281828459046       1 2  5.436563656918090       2 3  13.59140914229523       5 4  40.77422742688568      15 5  141.3506550798703      52 6  551.8112111771861     203 7  2383.933163558582     877 8  11253.68676982045    4140 9  57483.50582642343   2114710  315252.7350555378  115975`

Looking up the sequence 1, 2, 5, 15, 52, 203, 877 in Sloane's On-line Encyclopedia of Integer sequences leads us to "Bell or exponential numbers: ways of placing n labeled balls into n indistinguishable boxes."  So if you have a way of computing the Bell numbers, you can multiply e by the Bell numbers to get these sums.

But the ways of getting the Bell numbers look as complicated, or more so, than the computations in this program. Of course, you could start with a list of the Bell numbers and just multiply by e.

In fact, this could be one way of calculating the Bell numbers:

`1  2.718281828459046                12  5.43656365691809                 23  13.59140914229523                54  40.77422742688568               155  141.3506550798703               526  551.8112111771861              2037  2383.933163558582              8778  11253.68676982045             41409  57483.50582642343            2114710  315252.7350555378          11597511  1844544.500337454          67857012  11453744.15754954         421359713  75145370.75508085        2764443714  518918158.0577521       19089932215  3759271082.385662      138295854516  28487979957.85786     1048014214717  225250069805.8378     8286486980418  1854076987795.393    68207680615919  15855037146092.58   583274220505720  140600839423552    5172415823537221  1290829992142583  47486981615675122  1.225052349785174D+16  4506715738447322`

Only the limitations on the accuracy of this particular programming language make the last Bell number approximation off by 1 in the units position.

 Posted by Charlie on 2008-02-19 12:42:02

 Search: Search body:
Forums (0)