Questions tagged [summation]

Questions using the Sum command, especially for series and other algebraic objects, and related functions such as SumConvergence

Filter by
Sorted by
Tagged with
36
votes
7answers
4k views

How to differentiate formally?

I have been wrapping my head around this for a while now and I have not found a solution so far. I want to work with an arbitrary number of variables in Mathematica and use some built in functions. To ...
17
votes
5answers
3k views

Ways to compute inner products of tensors

One way to evaluate the following sums is combining Table and Sum: $u_{abcd} = \sum_{e=1}^3 v_{aeb}w_{ced}$ $q_{ab} = \sum_{d,e=1}^3 v_{d e a}w_{deb}$ It will look like ...
13
votes
5answers
989 views

Double series over primes

I'm very curious if the following double series over primes has a closed form: $$\sum_{k \in \mathcal{P}}\sum_{n \in \mathcal{P}}\frac{1}{k\;n(k+n)^2}$$ where $\mathcal{P}$ denotes the set of all ...
11
votes
5answers
10k views

How to sum over a List

list = {11.5575, 11.397, 5.52734, 4.0878, 2.54815, 1.86652, 2.55028, 2.14952, 1.6242, 1.34117} I have a list of numbers. How do I make a function that creates a ...
8
votes
2answers
334 views

Error computing sum of sum of digits

I've defined a function that computes the sum of the base-b digits of n: DigitSum[n_, b_] := Total[IntegerDigits[n, b]] Then I defined a function that computes ...
19
votes
2answers
5k views

Sum or Product with Exclusions

Is there a built-in feature for handling things like: $$\sum_{\substack{i=0\\i\ne j}}^n\frac{a-a_i}{a_i-a_j}$$ and $$\prod_{\substack{i=0\\i\ne j}}^n\frac{a-a_i}{a_i-a_j}$$ or should I work out some ...
22
votes
3answers
481 views

sudden increase in timing when summing over 250 entries

I see a sudden increase of Timing by a factor of thousands when I sum over 250 elements of a matrix rather than over 249. So for instance, this table contains sums ...
17
votes
2answers
15k views

How do you put conditions on indices in a sum?

I'm relatively inexperienced with mathematica, so I apologize if this is a trivial question. I want to take a double sum over a function $f(i,j)$ of two indices, of the form $$ \sum_{i = -\infty}^\...
7
votes
2answers
653 views

Summa package problem

I need to use the features of the Summa package but it doesn't work in Mathematica 9. It gives the error Cannot open Utilities`FilterOptions` My question is: ...
4
votes
2answers
1k views

Solve sum with indices

I'm trying to check some equations I did on paper, but I have troubles getting Mathematica to solve them. The equation (with Latex): My input: ...
4
votes
3answers
2k views

Sum over multiple indices

I would like to be able to enter the following left hand side of an identity. I can write the right hand side (i think) but am not sure about the left. The Left hand side is $$\sum_{i_1+i_2+...+i_n=...
14
votes
7answers
2k views

Numerical evaluation of a sum

I am trying to compute numerically NSum[(-1)^n/n^3, {n, 1, Infinity}]. Of course, using first Sum would work here, but often it'...
9
votes
3answers
294 views

Expand series unevaluated

I'm newbie in Mathematica. I'd like to obtain nice and verbose output for any series calculation. For example, given a simple sequence n*(-1)^(n-1) and ...
6
votes
2answers
135 views

Sum considers RandomInteger[] as a constant

Perhaps this is expected behavior, but I was kind of surprised by the following: ...
3
votes
1answer
957 views

How can I speed up this code with multiple sum?

There are 4 variables in this multiple sum, therefore it may take a long time. I have run this program for 12 hours, but no result untill now. I want to know how to speed up this code. Any help or ...
12
votes
3answers
528 views

The speed of Sum[] varies strangely

I was curious about the difference in speed between Total and Sum. I found out Total was ...
7
votes
1answer
172 views

SumConvergence difficulty

Backslide introduced in 9, persisting through 11.2. Consider the series $\sum_{n=1}^\infty\sin\frac{50}{n^2}$. The terms are eventually positive. ...
3
votes
2answers
3k views

How to compute the partial trace of a 4x4 matrix?

I want to compute a partial trace using formula $\rho_A=\sum\langle B|\rho_{AB}|B\rangle$ . Example, $\rho_{AB}= $$ \begin{pmatrix} a & b & c & d\\ e & f & g & h\\ i &...
13
votes
3answers
491 views

Find asymptotics of $\sum\limits_{i=0}^{n/3} 2^i \binom{n-i-1}{\frac{2n}{3}-1}$

I have an expression 2^n / Sum[ 2^i Binomial[ n - i - 1, 2n/3 - 1], { i, 0, n/3}] ...
4
votes
3answers
1k views

Summation with constraints

I am trying to do the summation shown below, $\sum_{i_1=0}^{imax_1} \sum_{i_2=0}^{imax_2} \dots \sum_{i_k=0}^{imax_k} f(i_1,\dots,i_k)$ $k$ is a variable. Therefore $i$ and $imax$ are defined as ...
10
votes
3answers
1k views

How can I compute a Kronecker sum in Mathematica?

There is Kronecker product but there is no Kronecker sum? It seems like a very important features to include. So in the absence of a Kronecker sum function, how can I construct my own Kronecker sum $...
7
votes
1answer
784 views

Compile nested Sums

I want to compile an expressions that contains nested Sum-expressions. A simple example that gives me problems is: ...
4
votes
1answer
282 views

Summation with jump indices like 1,4,6,9?

I is easy to enter $ \sum_{s=1}^{n}k(s) $ But how can I enter $ \sum_{s=1,3}k(s) $ ? When I try it, Mathematica says ...
1
vote
1answer
664 views

Creating my own midpoint rule function in Mathematica

I'm building my own function that is basically a midpoint riemann sum, but I cannot seem to get it to work. Currently I have ...
15
votes
1answer
355 views

Why does Mathematica think this series doesn't converge?

Bug introduced in 10.0 and fixed in 11.1 (reported as CASE:3790525) Here's a simple series: Sum[t^k DiscreteDelta[k]/k!,{k,0,Infinity}] Mathematica says that ...
11
votes
6answers
529 views

Performing Computations on Sets

I would like to find a permutation of $\quad S=\{\frac{1}{10}, \frac{1}{2}, \frac{4}{7}, \frac{3}{5}, \frac{2}{3} \}\quad$ that maximizes the sum of theses elements raised to unique powers: $\;\{0,1,2,...
8
votes
1answer
992 views

Understanding Dirichlet regularization in Sum

I've tried to calculate few classic sums using Dirichlet regularization: ...
7
votes
2answers
3k views

Can I define a function for vectors of arbitrary dimension?

Is it possible to do analytic calculations with Mathematica? For example, I want to compute: $$\partial \frac{\sum_{j=1}^n G_{j} \prod_{k=1}^{j-1} (1 - G_{k})}{\partial G_l}=-\prod_{k\neq l} (G_k-1)$$...
4
votes
1answer
393 views

Is this a bug of NSum?

Check this: NSum[Log[Abs[m]],{m,1,24}] (*54.7847*) NSum[Log[Abs[m]],{m,1,25}] NSum::nsnum: Summand (or its derivative) (Abs^[Prime])[m]/Abs[m] is not ...
3
votes
1answer
122 views

Leave out a term when summing

I'm calculating the Madelung constant $$\alpha = -\sum_{n_1,n_2,n_3}{\frac{(-1)^{n_1+n_2+n_3}}{(n_1^2+n_2^2+n_3^2)^{1/2}}}$$ Where $n_1,n_2,n_3$ are any element in the integer domain and they can't ...
2
votes
2answers
240 views

How to exclude numbers in a series and still plot the graph? [duplicate]

I want to plot this: $\displaystyle\sum_{n=-{10}\atop n\ne \pm 1}^{10} \dfrac {4i(-1)^{n}n}{(n^2 - 1)^2}e^{inx}$ but have no idea how I can exclude the cases for when $ n = \pm 1 $. I don't wish to ...
2
votes
2answers
687 views

define variable index

im in the medal of coding and i reached the point where i have something like this, the problem is i have up to 35 terms and all should be index in order to preform summation to count all ...
2
votes
2answers
170 views

The proper way to write the input for a certain series

Mathematica tells the series below doesn't converge. I think it converges. What would the proper way to write things be as an input? ...
1
vote
1answer
76 views

Why is the function assuming not taken in consideration?

In the following code, I assume that my variables are strictly positive. However, mathematica doesn't take this in consideration when it evaluates the If : the If is still in a non simplified form. ...
1
vote
2answers
234 views

Strange evaluation of an sum involving binomial coefficients

I stumbled upon this problem while playing with Mathematica 10. Can anyone help me explain the following behaviour? I define a sum ...
1
vote
0answers
161 views

Manipulating infinite series

If I type Sum[f[x],{x,m,Infinity}]-Sum[f[x],{x,m+3,Infinity}] I would like Mathematica to return something like ...
1
vote
1answer
547 views

Constraint on variables in summation

Is it possible to have a constraint on variables in summation of series just similar to pattern constraint e.g. ...
1
vote
3answers
535 views

Plotting Solution to Heat Equation

By hand, I've solved the heat equation and looking to 3D plot the solution. My function is $$2\sum_{n=1}^{\infty}\frac{(-1)^n}{n}\sin(nx)e^{-111n^2t}$$ The code I've been trying to use to far is <...
0
votes
1answer
78 views

Infinite Sum - Result not correct for all cases?

Evaluating the Sum Sum[a^i, {i, ∞}] yields -(a/(-1 + a)) which obviously only holds ...
37
votes
2answers
832 views

$\sum_{k=1}^{\infty }\left\lfloor\frac{5}{5^k}\right\rfloor$ giving wrong answer?

Bug introduced in 7.0 or earlier and fixed in 11.0.1 When I try to evaluate the following: $$\sum_{k=1}^{\infty }\Bigg\lfloor\frac{5}{5^k}\Bigg\rfloor$$ using ...
10
votes
2answers
2k views

Simplifying expressions involving Sum

I am trying to use Mathematica to simplify a symbolic expression involving Sum. The expression is defined as follows: ...
1
vote
1answer
2k views

Derivative of an expression containing a symbolic sum [duplicate]

Is there a general pattern for working with symbolic sums in Mathematica? For example here's a derivative I want to compute: ...
12
votes
2answers
581 views

Asymptotics of $\frac{\sum _{i=0}^{\lfloor n/2 \rfloor} {2(n-2i) \choose n-2i} {n \choose 2i} {4i \choose 2i}}{2^{3n - 1}}$

I am fairly sure that asymptotically $$\frac{\sum _{i=0}^{\lfloor n/2 \rfloor} {2(n-2i) \choose n-2i} {n \choose 2i} {4i \choose 2i}}{2^{3n - 1}} \sim \frac{2}{\pi n}.$$ I tried Limit[n*Sum[...
5
votes
1answer
972 views

Von Mangoldt function

Can anybody evaluate the following sum for me $$ \sum\limits_{n=2}^\infty(-1)^n\left(\frac{\psi(n)}{n}-\frac{\Lambda(n)}{2n}\right) $$ where $\psi(n)$ is the Chebyshev function and $\Lambda(n)$ is ...
4
votes
2answers
415 views

How to sum elements of a list of lists?

I know, the title may seem complicated. I have this list: myList = { {1, 0},{2, 3},{4, 1} } I want to sum all the sublists (element by element) to obtain this ...
2
votes
2answers
858 views

Dynamic nested sum

I would like to dynamically create nested sums with a dynamic number of parameters aswell. We do know the number of variables. Lets say we have 3 Variables with S being an array: $$ i=(1,\dots,m), j=(...
1
vote
1answer
142 views

How to simplify the equation and speed up the codes for four 100*100 matrices

I have to make a sum over 4 variables. Each variable corresponds to a 100*100 matrix. I want to know how to speed up this code. This problem is related to the previous problem 1 and 2. But now I need ...
10
votes
3answers
465 views

How to implement symbolic Ramanujan's summation in Mathematica?

How to implement Ramanujan's summation in symbolic form in Mathematica? For instance, I want as input the function $f(x)=x$, as output $-1/12$, as input $f(x)=1/x$, as output $\gamma$ (Euler's ...
7
votes
2answers
258 views

How to represent $f(x) = (y-x)^k \log(y-x)$ as a summation of the form $f(x) = \sum\limits_{j=0}^\infty \cdots$?

I am having a lot of trouble working with summations in Mathematica, and this is unfortunate as it is my main use case for the application My latest summation issue is the following. I am trying to ...
6
votes
2answers
976 views

symbolic summation involving kronecker delta

I have to perform symbolically summations of this kind $\sum_{ijkl} V_{ijkl} c_i c_j c_k \delta_{l,m}$ where $V_{ijkl}$ are quantities which depend on 4 indices and $\delta_{l,m}$ is the kronecker ...