# Tag Info

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

0

Maybe this give you some idea: Plus[Sequence @@ Table[Gamma[k/2]/k!, {k, 1, 1000}]] // N so = Plus[ Sequence @@ Table[Gamma[k - 1/2]/(2 (2 k - 1)!), {k, 1, 1000}]] // N se = Plus[Sequence @@ Table[Gamma[k]/(2 k)!, {k, 1, 1000}]] // N se + so I know this is not an answer but I am under 50 reputation and can not post comment.

3

Just regularize: Sum[Gamma[k/2]/(2 k!), {k, 1, ∞}, Regularization -> "Abel"] 1/4 (2 π Erfi[1/2] + HypergeometricPFQ[{1, 1}, {3/2, 2}, 1/4])

1

Your unknowns t = {tx, ty} Assuming you have already defined your v and L on your own, here I provide some random values for them Option 1 ClearAll[v, L] Do[v[i] = RandomReal[1, 2], {i, 7}] Do[L[i] = RandomReal[1], {i, 7}] your equation Sum[(v[i] + t)*(Norm[v[i] + t] - L[i]), {i, 1, 7}] == 0 Option 2 ClearAll[v, L] v = RandomReal[1, {7, 2}] ...

1

If[Read[StringToStream[$Version], Number] >= 9 ,FilterOptions[a_,b___] := Sequence @@ FilterRules[{b}, Options[a]] ]; would be a general use bridge to make notebooks and packages before version 9 and later compatible with respect to FilterOptions being superseded by FilterRules having a different call interface. You may place it into ... 0 I don't quite see what you mean by simplifying it further, other than perhaps re-grouping the terms. Do you see any possible cancellations ? I took a simple version of your problem and here is what I see: In[47]:= a = {{a1}}/za; b = {{b1}}/zb; c = {{c1}}/zc; d = {{d1}}/zd; k = {{k1}}; s = {{s11}}; G = a.Transpose[a] + b.Transpose[b] + c.Transpose[c] + ... 0 Since the question "Efficient tensor product followed by contraction" asking for an efficient solution to this problem has been marked as a duplicate, I find it appropriate to add here an encapsulated version of the answer to that question by @m_goldberg. Note that this works efficiently for the contraction of any number of index pairs. The notation follows ... 1 This bug was present in Mathematica version 8.0:$Version Assuming[ -nn <= m <= nn && m \[Element] Integers, Simplify[Sum[KroneckerDelta[m, n] f[n], {n, -nn, nn}]] ] Since version 9.0 this Sum remains unevaluated:

3

As noted, this is due to the fact that the indefinite sum is $0$: Sum[Binomial[n - r - 1, n - r], r] 0 One simple cure is to split off the "peculiar" term, Sum[Binomial[n - r - 1, n - r], {r, 0, n - 1}] + Binomial[n - n - 1, n - n] but an even better route is to flip the binomial coefficient: Assuming[n ∈ Integers, Simplify[Sum[(-1)^(n - ...

Top 50 recent answers are included