# Tag Info

2

Please see example below: Table[(10^i)*10^i, {i, 18}] Reference: Table

0

First part Initial sequence elements. Reverse[Table[HoldForm@10^n, {n, 1, 17}]] To see the product of that sequence: Times @@ Table[HoldForm@10^n, {n, 17}] With For construct: For[a = {}; n = 1, n < 18, n++, a = Append[a, HoldForm@10^n]; Print[a, "; Product = ", Times @@ a]] Second part Your For structure that you describe in words makes ...

2

in Mathematica using a list, and functions that manipulate lists, is better than using loops: for , do , while ... . But you can do this, with both of them, and also with "definite product" from Basic Math Assistant palette. (Calculus Commands tab on the Palettes menu -> Basic Math Assistant -> Basic Commands). With the palette: With a loop: a = 1; ...

3

I'm a little late to the party, but to me the fun of the problem is to approximate E without referring to E. That includes not using $\Gamma$-related functions, at least in my understanding of $\Gamma$. That means, I think, I might ought to implement factorial as a product; or perhaps since speed is not issue, at least in my approach, I could use n! with ...

7

Accumulate works too... FirstPosition[Thread[Accumulate[1./(Range[0, 10]!)] - E > -0.001], True] {7}

8

Notice the partial sum can be expressed in terms of (incomplete) Gamma functions. Sum[1/n!, {n, 0, k}] (E Gamma[1 + k, 1])/Gamma[1 + k] So we can use this closed form in something like FindRoot and it should be pretty fast. Ceiling[k /. FindRoot[E - Sum[1/n!, {n, 0, k}] == 1/1000, {k, 10}]] + 1 7 Edit Using GammaRegularized as J.M. mentioned ...

5

First@NestWhile[ {#[[1]] + 1 , #[[2]] + 1/#[[1]]! } &, {0, -E}, Abs[#[[2]]] > .001 & ] 7

2

Update To correct mistake as per comments Catch@Scan[If[E - NSum[1/n!, {n, 0, #}] < 0.001, Throw[# + 1]] &, Range@100] 7

2

You may start with something like that equ = {-y'[t] + 1 + (1 + \[Epsilon]) y[t]^2}; y[t_] := Sum[x[i][t] \[Epsilon]^i, {i, 0, 10}] // Evaluate; First order solution (use SeriesCoefficient function to expand equation with series substituted) x[0] = x[0] /. First@DSolve[{First@SeriesCoefficient[equ, {\[Epsilon], 0, 0}] == 0, x[0][0] == 1}, x[0], ...

6

One possibility is: se[n_Integer, x0_:1] := Collect[(Normal[ O[la]^(n + 1) + Expand[Normal[ Series[V, {x, x0, n}, {y, 0, n}, {z, 0, n}]]] /. {x -> la x, y -> la y, z -> la z}] /. la -> 1) /. x -> (x0 + XM), XM] /. XM -> (x - x0)

2

I think there are two issues here. The first is that LogicalExpand is for expanding logical expressions, like so: In[1]:= LogicalExpand[(a || b) && (b || c)] Out[1]= (a || b) && (b || c) Second, you can actually work directly with power series and expand them about $\infty$, as follows: In[2]:= series = Series[f[(a L /x)], {x, Infinity, ...

4

Many many (15?) years ago I wrote this, which may be of help.

3

Here's a starting point (borrowing the notation from here): With[{n = 5, m = 10}, (θ = 1 + Sum[C[k] ξ^k, {k, 2, m}] + O[ξ]^(m + 1)) /. First[SolveAlways[ξ D[θ, {ξ, 2}] + 2 D[θ, ξ] + ξ θ^n == 0, ξ]]] 1 - ξ^2/6 + ξ^4/24 - 5 ξ^6/432 + 35 ξ^8/10368 - 7 ξ^10/6912 + O[ξ]^11 Compare: Series[1/Sqrt[1 + ξ^2/3], {ξ, 0, 10}] 1 - ξ^2/6 + ξ^4/24 - 5 ...

Top 50 recent answers are included