New answers tagged

2

As a workaround for this incorrect simplification, you could use FindSequenceFunction on a sample of concrete results: Clear[m,n,k]; Simplify[FindSequenceFunction[ Table[ Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}], {m, 2, 12, 2}], n] /. n -> m/2] (* ==> 2^(-4 + m) (-2 + m) *) This is similar to the answer by @Coolwater here.


4

I don't know why (it may be related to how Binomial is handled internally but the expression Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}, Assumptions -> m/2 \[Element] Integers && m > 10] returns 0. However if we replace Binomial with the equivalent factorial expression the result is: sumM = Sum[((k - 1) (m - 1)!)/(k! (m - k)!), {k, ...


3

I would suggest defining your sum as a function f[m_?NumericQ] := Sum[Binomial[m - 2, k - 1] (k - 1), {k, 2, m, 2}] /; EvenQ[m]; This evaluates fine and does not give zero when given numeric values. The root of the problem seems to me to have to do with the definition of Binomial internaly as a combination of Gamma functions. "In general,Binomial[n,m] ...


4

I would suggest adding option GenerateConditions->False to Integrate to speed up the integration. Then, instead of D, use Derivative. Then, to generate a SeriesData apply Series: f[x_] := 1/x; max = 4; em[n_Symbol] := Series[Integrate[f[x], {x, 1, n}, GenerateConditions -> False] + (f[1] + f[n])/2 + Sum[BernoulliB[2 k]/(2 k)! (Derivative[2 ...


6

TL;DR - Evaluate the function for just one value before trying to plot it. This will always save you hassle and headaches. And if your function involves a summation out to infinity, make sure it converges. Use atomic units when working on atomic-scale problems. I personally stay away from the Units functionality altogether, and just enter the numbers in ...


0

In the documentation of KroneckerDelta says: Use in sums to pick out elements: Sum[KroneckerDelta[a, 3] f[a], {a, Infinity}] (*f[3]*) Just do the sum in l with {l,Infinity} Assuming[m > 1 && m \[Element] Integers, Sum[ KroneckerDelta[l, m] f[m], {l, Infinity}]] (* f[m] *) f is your other sums.


0

Here's a related example of this bug: Replacing Floor by Ceiling we get the sum Sum[(-1)^Ceiling[n/2]/Binomial[n + 2, 2], {n, 0, \[Infinity]}] (* Out[139]= 0 *) which is returned as 0 whereas the correct value is Sum[(-1)^Ceiling[n/2] x^n/Binomial[n + 2, 2], {n, 0, \[Infinity]}] /. x -> 1 % // N (* Out[142]= 2 - 2 Log[2] *) (* Out[143]= 0.613706 ...


0

The answer returned by Sum for the example with Floor is certainly incorrect. Sum attempts to evaluate this example by reducing the input to an expression without Floor. The bug occurs due to a problematic variable localization while trying to evaluate the resulting rational-exponential sum. Sorry for the confusion caused by this problem.


2

I agree that this appears to be a bug. Indeed, the partial sums described by the OP in a comment are the same. For instance Table[Sum[(-1)^ m*(1/Binomial[2*m + 2, 2] + 1/Binomial[2*m + 3, 2]), {m, 0, mm}], {mm, 0, 20}] == Table[Sum[(-1)^Floor[n/2]/Binomial[n + 2, 2], {n, 0, nn}], {nn, 1, 41, 2}] (* True *) This is because sums of pairs of ...


1

The code at http://oeis.org/A006784 works for me: EngelExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Ceiling[1/Expand[#[[1]] #[[2]] - 1]], Expand[#[[1]] #[[2]] - 1]} &, {Ceiling[1/(A - Floor[A])], A - Floor[A]}, n - 1]] res = EngelExp[N[E/Pi, 500000], 27] returns: {2, 2, 3, 3, 7, 23, 43, 58, 30503, 32703, ...


4

Algebra approach. Dot Wwith a column vector of 1's. W . ConstantArray[1, {Last@Dimensions@W, 1}] Was just curious if Dot approach was faster than Total/@ for large symbolic matrices after reading comments. sqSymMx[m_Symbol, n_Integer?Positive] := Table[Indexed[m, {i, j}], {i, n}, {j, n}]; t = With[{r = sqSymMx[x, #]}, {#, First /@ ...


5

List@*Total /@ W (V10 only) List /@ Total /@ W (V10 or earlier) (* {{Subscript[x, 11] + Subscript[x, 12] + Subscript[x, 13]}, {Subscript[x, 21] + Subscript[x, 22] + Subscript[x, 23]}, {Subscript[x, 31] + Subscript[x, 32] + Subscript[x, 33]}} *) other alternatives: List /@ Plus @@@ W List /@ Total[W, {2}]


7

List@*Total /@ W % === g $\ $ True


2

The following also works SetAttributes[S3, HoldFirst]; S3[expr_, indices__] := With[{ex = Unevaluated[expr]}, (Sum @@ Join[{ex}, Map[{#, 1, 2} &, {indices}]])]


2

One possibility: a[i_, j_] := D[u[i], u[j]] ClearAll@S2 SetAttributes[S2, HoldFirst] S2[expr_, indices__] := Sum @@ Join[Inactivate@{expr}, Map[{#, 1, 2} &, {indices}]] // Activate; S2[b[i, j], i, j] S2[a[i, j], i, j]



Top 50 recent answers are included