The tag has no wiki summary.

learn more… | top users | synonyms

16
votes
2answers
870 views

Sum or Product with Exclusions

Is there a built-in feature for handling things like: $$\sum_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$ and $$\prod_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$ or should I work out some sort of ...
13
votes
1answer
240 views

Baffling increase in runtime

Background of my question I discovered Project Euler today, and decided I would work through the problems in Mathematica. I became obsessed with the first problem, which is essentially "sum all the ...
12
votes
4answers
1k 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. ...
10
votes
5answers
517 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 ...
9
votes
6answers
403 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: ...
8
votes
5answers
2k views

Sum all numbers from 1 to 1000 divided by either 2,3,5 or 7

How do I find the sum all numbers from 1 to 1000 divided by atleast one of 2,3,5 or 7? EDIT: I am sorry for complicating this, but I need it to work for 10^11. So anything that requires too much heap ...
8
votes
2answers
178 views

sudden increase in timing when summing over 250 entries

Using math 9.0.1 on a MacBook Air, 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 ...
7
votes
6answers
676 views

Alternating sum

A frog is at the bottom of a 30 metre well. Each day it climbs 5 metres up the side, but it then slips back 3 metres each night. How long does it take to reach the top of the well? Is there an easier ...
7
votes
2answers
160 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 ...
7
votes
2answers
292 views

Find asymptotics of Sum[2^i*Binomial[n-i-1,2*n/3-1],{i,0,n/3}]

I have an expression 2^n / Sum[ 2^i Binomial[ n - i - 1, 2n/3 - 1], { i, 0, n/3}] ...
7
votes
1answer
89 views

Bug in GeneratingFunction?

According to the documentation GeneratingFunction[a[n],n,x]==Sum[a[n]x^n,{n,0,Infinity}] However, for $a_n=1/(n+2)$ I obtain ...
6
votes
3answers
862 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 ...
6
votes
2answers
2k 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 = ...
6
votes
1answer
214 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: ...
6
votes
0answers
150 views

Incorrect evaluation for Thue-Morse signed harmonic series

I would like to evaluate $$s = 1 - \frac{1}{2} - \frac{1}{3} + \frac{1}{4} - \frac{1}{5} + \frac{1}{6}+\frac{1}{7}-\frac{1}{8} - ... + \frac{(-1)^{\textrm{binary digit sum}(n-1)}}{n} + ... $$ where ...
5
votes
1answer
296 views

Problem with creating a large list of tuples

This is a follow-up question from Sum of Multinomial Coefficients I have thought about the meaning of the formula I mentioned and, with help, I implemented the following code: ...
5
votes
1answer
186 views

Summing tensors in mathematica

How do I perform the following summation in mathematica? \begin{equation} \Sigma_{m=1}^5 e_{ijklm}A^{mn} \end{equation} I have the $e_{ijklm}$ tensor of rank 5 in 5 dimension as a array and $A^{mn}$ ...
5
votes
3answers
210 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 ...
4
votes
5answers
1k 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 ...
4
votes
2answers
236 views

What causes this strange convergent sum?

N[Sum[1/(x^2 + 1), {x, 1, Infinity}], 5] N[Sum[1/(x^2 + x + 1), {x, 1, Infinity}], 5] 1.0767 0.79815 + 0.*10^-6 I What causes the strange number?
4
votes
3answers
373 views

Why the difference?

When I do the double sum using the sigma notation I get $$1 + \sum_{n=0}^{\infty}\sum_{k = n}^{\infty} \frac{1}{(k+2)k!}$$ $1 + e - \cosh[1]$ When I do the sums as below, I get the expected ...
4
votes
1answer
208 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 ...
4
votes
3answers
156 views

Long waiting time for computing a summation

It takes a long time to compute the summation below, and I'd like to know if there are alternative ways to compute things faster. When replacing $15$ by $\infty$, then I should get $3^{1/3}$. I need ...
4
votes
2answers
178 views

Numerical sum does not give consistent results

Consider the function ...
4
votes
2answers
146 views

Speed up plot of $\sum_{j\ge1} 2^{-j}(1-2^{-j})^{n-1}$

I'm a beginner at Mathematica. I would like to plot the following function: $${n\over2} \sum_{j\ge1} 2^{-j}(1-2^{-j})^{n-1}$$ However the following code is just too slow: ...
4
votes
2answers
433 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} ...
4
votes
3answers
331 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 ...
4
votes
1answer
140 views

Variable number of nested variable-range sums

I would like to express the following nested sum in Mathematica: $$ S(m,j,N) = \sum_{k_1=m+j-1}^{N-1} f(N,k_1) \sum_{k_2=m+j-2}^{k_1-1} f(k_1,k_2) \cdots \sum_{k_m=j}^{k_{m-1}-1} f(k_{m-1},k_m) $$ ...
4
votes
1answer
74 views

Understanding Dirichlet regularization in Sum

I've tried to calculate few classic sums using Dirichlet regularization: ...
4
votes
2answers
147 views

Solve a system of M equations without specifying M

This post has been edited heavily in response to the comments: my initial question was very confusing. I am trying to write my game-theoretic model in Wolfram Language. There is only one remaining ...
4
votes
2answers
381 views

Problems with Symbolic summation over unknown values

I'm having some real trouble with Mathematica wrongly evaluating various symbolic sums at the moment. I have this function: $$h_{ij}(x) = ...
3
votes
2answers
287 views

Incorrect value of infinite sum

Wolfram Alpha and Mathematica give an incorrect result (numerically) for the following infinite sum: ...
3
votes
3answers
539 views

Sum of Multinomial Coefficients

Basically, I want to write a function to compute the following sum $f(m,L):=\sum_{0\leq k_1,\cdots, k_n\leq m} \binom{m}{k_1,k_2,\cdots k_n}$ and $\mathrm{supp}(k)=L \subseteq \left \{ 1,...,n \right ...
3
votes
1answer
208 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 ...
3
votes
1answer
233 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 ...
3
votes
2answers
239 views

Simplifying expressions involving Sum

I am trying to use Mathematica to simplify a symbolic expression involving Sum. Particularly, I define a sum via ...
3
votes
1answer
300 views

Sum and NSum gives different solutions

I'm working on a Mathematica lab for Calc. 2, and I ran into a problem last night. I was trying to calculate the midpoint approximation of the definite integral of ...
3
votes
1answer
93 views

Collect terms in a sum

Suppose I have this expression ...
3
votes
2answers
660 views

Sum over all permutations

I have n variables and a function that has all of them as variables. n-3 of them in terms of the entries of two lists. The possible entries in the lists $\alpha$ and $\beta$ range from {2,...n-2}. Now ...
3
votes
1answer
31 views

Strange NSum behavior for slightly larger number of terms

For some sums, NSum gives me the result nicely for some number of terms, but if I add one more term, it suddenly becomes much slower. I haven't found the minimum example for which this can be ...
3
votes
1answer
187 views

Sum of positive terms gives negative answer

Mathematica evaluates Sum[((n - y - 1)*(n - y)^2*n^y)/y!, {y, 0, n - 2}] as -2 e^n n. This should not be a negative value. ...
2
votes
3answers
242 views

Sum with Levi-Civita [duplicate]

I'm trying to write the expression $$\sum_{\alpha,\beta = 1}^{4}\epsilon_{\mu \nu\alpha\beta}a^{\nu} b^{\alpha} c^{\beta}$$ in Mathematica, where $\epsilon$ is the Levi-Civita symbol and $a$, $b$, $c$ ...
2
votes
2answers
191 views

Triple series - evaluation delayed

Trying to figure out if the infinite triple series has a nice closed form. It seems Mathematica is unable to help us here. Numerically, things remain the same, no response. Could you help? ...
2
votes
2answers
336 views

Efficiently compute double sum

Is there a "Mathematica Way", like Map or Apply to compute the following double sum? $\sum_{i=1}^{N_1}\sum_{j=1}^{N_2} m_i n_j \, f(\tau_{i} \gamma_{j})$ I have already stored the lists ...
2
votes
2answers
106 views

Automatically generated summation region

In a multiple Sum I need to put an automatically generated summation region. But when I generate the summation region automatically I get a list whose elements are ...
2
votes
2answers
120 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
1answer
137 views

Reproducing a Plot done with WolframAlpha [duplicate]

I have problem to draw in Mathematica a plot like this: Plot[{Sum[a^10*(-1)^(x-a), {a, 1, x}]}, {x, 1, 10}] The problem is that on the plot there is no graph. As ...
2
votes
2answers
112 views

Plot with sum and binomial command

A few days ago I asked about a problem with plotting a sum. You advise me to use Evaluate option, and that helped me very. But now I have a very similar problem, but i can't find the mistake. I have a ...
2
votes
1answer
85 views

Evaluating terms in series

I'm trying to evaluate a simple expression: Subscript[λ, n] = (2 n - 1) π/(2 L); And then sum it up: ...