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
0
votes
2answers
87 views

Algorithm for Swapping indices and simplifying the summand in a double sum [closed]

Say we have something like $$ \sum_{p}^N\sum_{q}^N \cos(p) \sin(q) - \cos(q)\sin(p) $$ usually, in the case like this, the indices p and q can be swapped, and the sum simplifies to 0. I have an ...
2
votes
2answers
165 views

How to make lists the same size?

I want to add 19 lists together and then average over them but they are of unequal length. How do I make then all the same length? i.e. make them all the length of the smallest one. My lists are ...
2
votes
1answer
154 views

How to plot this double sum? [duplicate]

I want to plot solution of some physics problem that I solved (for r between 1 and 2 and for f between 0 and Pi). I tried it myself but since I am beginner in using Wolfram Mathematica I have not ...
2
votes
3answers
182 views

A restricted summation over a function of integer n-tuple

I want to sum over a function of n-tuple like so: $\sum\limits_{a\leq k_1+k_2+...+k_n\leq b}f(\{k_i\}_{i=1}^{n})$ where each $k_i$ is non-negative, i.e. $k_i\geq0 \;\forall\;i $ An Example: Say, ...
3
votes
2answers
149 views

Symbolic representation of a Bézier curve

The Bézier curve is defined by: $$C(t)=\sum_{i=0}^{n} {{n}\choose{i}} t^i (1-t)^{n-i} P_i$$ where the $P_i$ are the control points. I am trying to write it down in Mathematica. What I have is: <...
4
votes
1answer
82 views

sum simplification

I have this sum Sum[-E^(-j (x kx[p] + y ky[q] + z kz[r])) j g w ky[q] Ux[p, q, r], {p, -∞, ∞}, {q, -∞, ∞}, {r, -∞, ∞}] and I would like to pull constants ...
1
vote
3answers
126 views

Improving the sum over dummy indexes

I have the following tensor ...
1
vote
3answers
480 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 <...
2
votes
2answers
103 views

Problem when defining a function as a finite sum

I am using Mathematica 8.0.1.0. I defined the following function for use in an answer on math.SE: f[j_] := Sum[1/(j-2k+1)/4^k, {k, 0, Floor[j/2]}] I then used ...
0
votes
3answers
259 views

Gravitational potential of a cube

I want to write code that calculates the gravitational potential of an arbitrarily shaped celestial body. To understand the calculation, I started with an easy shape: a rectangle (or a cube). I ...
2
votes
1answer
71 views

Abs[.] breaks my infinite sum

The following evaluates correctly to pi^2/4: Sum[n^2 (Sin[n π]/(-1 + n^2))^2, {n, 1, ∞}] The following gives a 1/0 error: ...
0
votes
1answer
71 views

Determining the distribution and other characteristics of a variable defined by a recurrence relation

I want to determine the distribution and some other characteristics of a recursive defined variable and need hereby some help/advice. I have the recurrence relation $\qquad X_t = X_{t-1} + \phi (\...
17
votes
3answers
3k views

Mathematica thinks (-1)^n is non-real

When I ask Mathematica to evaluate NSum[((-1)^n)/n, {n, 1, 100}] it returns -0.688172 + 2.11297*10^-16 i Why is this? (-1)^n is either 1 or -1. I don't know why ...
1
vote
1answer
28 views

Sums involving KroneckerDelta and multi-term functions

I'm having trouble getting Mathematica (11.0.1.0, OSX High Sierra) to evaluate the following sum: $\sum_{i=0}^{\infty} f(i) \, g(i) \, \delta_{i,j}$ My code is ...
2
votes
1answer
92 views

Multiplying into an infinite sum

Suppose I define y = Sum[Subscript[a, k] x^k, {k, 0, Infinity}] which is a power series representation for y. Now if I multiply <...
2
votes
2answers
74 views

Nested sum in replacement rule of unknown size

I have a function which takes a list as its argument, and I want to transform it by multiplying by a matrix for each element of a list. To be specific, I want the following transformation: $$\hat{f}_i ...
3
votes
0answers
124 views

How to find the closed form of a relatively simple sum?

I'm trying to find the sum $ \sum_{n=1,3,5}^\infty \frac{8}{n \sinh (n \pi)} $ Sum[8/(Sinh[n*Pi]*n), {n, 1, Infinity, 2}] which I know is ln(2), but Mathematica ...
0
votes
1answer
88 views

Sum over permuted and unpermuted indices

I would like to write a code to evaluate the following (up to $N=20$) $\sum_{s_1,...,s_N=\pm 1;s_1 \cdot \cdot \cdot s_N=1}\sum_{\sigma\in S_N}\prod_{i=1}^N x_{\sigma(i)}^{s_i \lambda_i}$ There are ...
5
votes
2answers
164 views

Why does SumConvergence return unevaluated?

I am trying to confirm that the series $$\sum_{n=1}^{\infty}\frac{\cos^2(n)}{\sqrt{n}}$$ diverges. However, when I try to use SumConvergence or ...
2
votes
1answer
82 views

Summation does not simplify

Inspired by the identity listed in this problem, I tried 2 π Sqrt[2]/9801 Sum[((4 k)! (1103 + 36390 k))/((k!)^4 396^(4 k)), {k, 0, \[Infinity]}] and got <...
0
votes
2answers
103 views

Problems with If condition when Pochhammer symbols are zero

There is a formula for the hypergeometric ($_2F_1$) that expresses it as a sum of Pochhammer symbols, times something that reads $$_2F_1(a,b,c;x) = \sum_{i=0}^{\infty} \frac{(a)_i (b)_i}{(c)_i} \frac{...
1
vote
1answer
206 views

Pass a list of tuples into Sum

I have a function of two arguments, f[x_,y_], and I want to sum the value of this function for a number of input tuples {x,y} ...
1
vote
2answers
438 views

How to solve for all coefficients in a sum

The statement of the problem: In the following formula, $$g(u,v) - \sum_{\Delta,l} c_{\Delta,l} u^{\frac{1}{2}} G^{(l)}\Bigg(\frac{1}{2} (\Delta-l),\frac{1}{2} (\Delta-l),\Delta,u,v \Bigg) = 0$$ ...
0
votes
1answer
136 views

Return analytic expression

I would like to evaluate this summation: \begin{align} \sum_{j=1}^{NM}\left[(u_{j_x} + u_{j_y})^2 - 2(1-\rho) u_{j_x} u_{j_y}\right], \end{align} where $NM$ is some number greater than or equal to $...
1
vote
1answer
137 views

A hypergeometric sum that fails

Input: Sum[Binomial[k+n-1, n]*Binomial[k, n-k]/k, {k, 1, n}] Output: ...
2
votes
2answers
82 views

Infinite sum for all valid triangles triples (a, b, c)

Find the infinite sum of f(a, b, c) = ((2 / 5) ^ a) * ((11) ^ (-c)) * ((7 ^ (-a - b)) for ordered triples(a, b, c) such that a, b, c satisfy the triangle inequality. I simplified the input to a ...
0
votes
2answers
111 views

Code to calculate the partial theta function

The version of the partial theta function I want to compute is $O(z) = \sum\limits^\infty_{n=0}\exp(-(z+n\pi)^2)$ Does anyone have or know of code to efficiently compute $O(z)$? There are two papers ...
1
vote
1answer
59 views

How to perform this indefinite sum?

The following indefinite sum with (CC[n]=1 for even n and CC[n]=i for odd n) ...
1
vote
0answers
50 views

Symbolic summation with variable bounds and variable number of indices

I wish to compute compute terms like Sum[f[t[j[1]],t[j[2]],...],{j[1],m},{j[2],n},...] for arbitrary positive integer n and any ...
1
vote
1answer
239 views

Sum of kronecker delta

What else is needed to make Mathematica to simplify the following expression to $z[j]$? Code: ...
0
votes
2answers
136 views

A simple code for conditional double summation?

I wrote a code as follows ...
1
vote
0answers
96 views

Sum involving hypergeometric function $\mbox{}_1 F_2$

Trying to simplify the sum $$ \sum\limits_{n=0}^{\infty}\dfrac{z_1^n}{n!} {}_{1}F_{2}(1;a+n,1-a+n;z_2), $$ where $a\in(0,1)$, $z_1,z_2>0$, and ${}_{1}F_{2}$ denotes the appropriate version of the ...
1
vote
1answer
71 views

Summation and production using hold

Let's take a sum and an example production $z_{1}=\sum_{k=1}^{3}(k!+(k+1)!)$ and $z_{2}=\prod_{k=1}^{3}(k!+(k+1)!)$ I wish to get in z1 a result like that $...
3
votes
0answers
69 views

Wrong computation of a series with `FactorialPower`?

I wanted to compute the series defined by $$\sum_{k=1}^\infty\frac{(-1)^{k+1}}k x^\underline k$$ where $x^\underline k:=\prod_{j=0}^{k-1}(x-j)$ is a falling factorial. Thus I write ...
0
votes
2answers
55 views

Sum elemets of an array

I am not sure this is something that is possible to implement in mathematica, but my question is the following. I have a system three linear equation where the coefficients in front of each variable ...
4
votes
2answers
192 views

How do I deal with the summations correctly whose upper or lower bounds are symbolic?

I'm new to Wolfram Mathematica and I want to calculate the expression of s (with respect to n) to get the same result as this ...
5
votes
4answers
453 views

Summation over integers satisfying some conditions

$n$ is a fixed positive integer and $p$ is the largest prime $\le n$: p = Prime[PrimePi[n]] For each subset $L$ of positive composite integers less than or ...
1
vote
1answer
63 views

How can I plot a solution obtained from Stats.SE? [closed]

I am trying to implement a solution I got from stats.stackexchange.com in Mathematica, but I must be doing something wrong, because the output I am getting and the accepted answer from stats....
3
votes
3answers
642 views

Solving a system of diophantine equations from a mathematical competition

There is a problem from the $66th$ Putnam Mathematical Competition, $B2$ Find all positive integers $n,k_1,k_2,...,k_n$ such that $$k_1+\cdots+k_n=5n-4$$ and $$\frac{1}{k_1}+\cdots+\frac{1}{...
0
votes
0answers
43 views

Speeding up multiple conditional summations

I have situation where I have a matrix H, and want to build a set of ODEs dependent on the values of the eigenvalues, let me illustrate: ...
20
votes
1answer
292 views

Why is “k” in the output of Sum[Log[k]/k^k, {k,1,Infinity}]?

Fixed in 11.3 NSum[Log[k]/k^k, {k,1,Infinity}, WorkingPrecision->50] (* 0.219947267975228664843531307905860703797097130 *) But ...
1
vote
0answers
54 views

Summation with skipping a term

how do i sum the following in Mathematica: the m-th term is 1/(m^2 - n^2), the sum is over odd m and m <> n. i know the answer is -1/(4*n^2) or something like that. thanks !!
4
votes
3answers
98 views

Using list specification in NSum

The below gives the right answer for summing values from a list (as opposed to a mathematical function) but throws out a warning stating that "k cannot be used for list specification". ...
5
votes
1answer
103 views

Why does this nested sum appear to sleep between iterations?

I have a weird performance problem in a nested sum, which I've reduced to the following test case: ...
1
vote
1answer
587 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 ...
8
votes
3answers
311 views

How to represent integers using Egyptian fractions?

Let $N(n)$ be a set of integers, which can be presented using first $n$ Egyptian fractions: $$ N(n):=\{m\in\mathbb{Z}:\ \ m=\sum_{i=1}^n\frac{\epsilon_i}{i},\ \epsilon_i=0\ \text{or}\ 1\} $$ I want ...
2
votes
0answers
79 views

Convergent infinite sum fails to converge in Sum[…]

It looks like this. ...
1
vote
2answers
80 views

Can this expression be written in a simpler form?

Observe the following Wolfram Mathematica code which results in a table of integers: ...
1
vote
1answer
126 views

Sum convergence

I would expect the following sum to converge: $$ \sum_{n=-\infty}^\infty n=0 $$ Indeed I get: Sum[n,{n,-10^7,10^7}] (*0*) But running ...
1
vote
1answer
123 views

Calculate 40 digits of the MRB constant

MRB constant is the upper limit point of the following sequence $$s_n=\sum_{k=1}^{n} (-1)^k k^{\frac{1}{k}}$$ $MRB=\color{blue}{0.1878596}...$ I tried to calculate first few digits: ...