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

learn more… | top users | synonyms

33
votes
2answers
613 views

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

Bug introduced in 7.0 or earlier and persisting through 10.4 or later When I try to evaluate the following: $$\sum_{k=1}^{\infty }\Bigg\lfloor\frac{5}{5^k}\Bigg\rfloor$$ using ...
27
votes
5answers
3k 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. ...
17
votes
3answers
333 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
2k 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 ...
14
votes
2answers
252 views

Fastest way to sum the upper triangle

I feel like this is an recurring question: if there's a symmetric matrix whose diagonal is not all 0, how could I get the sum of the part of it that's above the diagonal as fast as possible? Small ...
14
votes
3answers
284 views

Symbolic sum of Stirling numbers gives wrong answer

Bug introduced in 9.0.1 or earlier and fixed in 10.4.1 This issue originated from my attempt to answer a question on MathOverflow: ...
14
votes
1answer
260 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
7answers
739 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'...
12
votes
3answers
415 views

Double Sum Involving Condition

I would like to compute the dimensions of some small free nilpotent Lie algebras. However, I am totally new to this and I could not figure out how to write the double sum which gives the dimension of ...
12
votes
5answers
814 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
6answers
464 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,...
11
votes
5answers
2k 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 ...
11
votes
3answers
410 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}] ...
11
votes
2answers
164 views

How to correctly implement in a new function the scoping behavior of Table, Sum and other commands that use Block to localize iterators?

It is documented that "Block is automatically used to localize values of iterators in iteration constructs such as Do, Sum, and Table." Therefore the dummy index (iterator) in a Sum is shielded ...
11
votes
2answers
295 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 ...
10
votes
2answers
6k 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}^\...
10
votes
2answers
333 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[...
10
votes
1answer
144 views

Bug in GeneratingFunction?

Bug introduced in 7.0 and fixed in 9.0.0 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 ...
9
votes
2answers
132 views

Evaluating summations involving Fibonacci numbers in terms of Fibonacci numbers

There are many summations involving Fibonacci numbers which Mathematica 10.4 is able to evaluate directly in terms of Fibonacci numbers. For example, Mathematica evaluates the summation given below as ...
9
votes
1answer
521 views

RootSum result manipulation/simplification

Consider the sum sum1 = Sum[ k/( k^7 - 2 k + 3), {k, Infinity}] ...
9
votes
1answer
169 views

SumConvergence[((-1)^n)/(Sqrt[n] + (-1)^n), n] returns True in Version 10.2?

Bug persisting through 10.4.1 I claim that the series $\sum_{n=2}^{\infty}\frac{(-1)^n}{\sqrt{n}+(-1)^n}$ diverges. To see this, rewrite the $n^{th}$ term as follows: \begin{equation*} \frac{(-1)^n}...
9
votes
1answer
83 views

Problem with simplification KroneckerDelta

Bug introduced in 8.0 or earlier and fixed in 9.0 I have: ...
8
votes
6answers
761 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 ...
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
4answers
274 views

Is it possible to find generating functions of infinite sequences with Mathematica?

I'm trying to find the generating function of a sequence as $(0,1,0,1,0,1,\dots)$ but reading Mathematica's help on FindGeneratingFunction[] seems to tell me that ...
8
votes
3answers
188 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 ...
8
votes
2answers
249 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 ...
8
votes
1answer
118 views

evaluation of the sum of KroneckerDelta

I need help. I need to know why the next code doesn't simplify in Mathematica 10 but it does in Mathematica 8. I need some similar in version 10. What can I do? ...
7
votes
5answers
4k 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 ...
7
votes
3answers
307 views

How to calculate this sum?

I want to find the sum $$S=f\left(\dfrac{1}{2012} \right) +f\left(\dfrac{2}{2012} \right) +\cdots + f\left(\dfrac{2011}{2012} \right), $$ where $$f(x) = \dfrac{4^x}{4^x + 2}.$$ I tried ...
7
votes
1answer
288 views

Differing answers when comparing Wolfram Alpha and Mathematica v.10.2

Out of curiousity, please consider following expression: Sum[(-1)^(n + 1)/n, {n, 1, 100000}] When evaluated using Wolfram Alpha: Result: ...
7
votes
1answer
118 views

Sum over Binomials and Gammas

Given the function, ...
7
votes
2answers
449 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: ...
7
votes
1answer
176 views

Why does this simple sum function fail to compile?

Consider the following compiled function, which takes a $12 \times 5$ array $x_{ij}$ of real numbers and computes the triple sum $$ \sum_{k=1}^5 \sum_{i=1}^{12} \sum_{j=i+1}^{12} x_{ik} x_{jk}. $$ <...
7
votes
1answer
414 views

Understanding Dirichlet regularization in Sum

I've tried to calculate few classic sums using Dirichlet regularization: ...
7
votes
0answers
192 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 ...
6
votes
4answers
192 views

Why does Mathematica return Indeterminate for this converging infinite sum?

Limit[Sum[k/(n^2 - k + 1), {k, 1, n}], n -> Infinity] This should converge to 1/2, but ...
6
votes
2answers
382 views

Bug in splitting sum

I was trying to evaluate the following sum. $$ \frac{2}{m}\sum_{\substack{\text{odd }k\\1\leq k\leq m-1}} f(\frac{m+2+\sqrt{m^2-4k+4}}{2})+f(\frac{m+2-\sqrt{m^2-4k+4}}{2}). $$ And I wrote the ...
6
votes
2answers
2k 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)$$...
6
votes
4answers
288 views

Define Function with Sum over a list

I want to define a function that would symbolically look like $$ t(s,\underline{a})=\pi s + \sum_{n=1}^{n_{max}}a_n\sin(n \pi s) $$ (something like a finite Fourier series). Here $s\in [0,1]$ and $\...
6
votes
1answer
107 views

Relevant help page for: Sum`?

When I type Sum into Mathematica, it also offers Sum` in the autocomplete dropdown, but when I click the little menu button next ...
6
votes
2answers
110 views

Wrong output from Mathematica when evaluating a summation

Consider the sum $$\sum_{r=0}^n \binom{n-r-1}{n-r}$$ This sum is not zero because when $r=n$, the result is $\binom{-1}{0} = 1$. However, plugging this formula into Wolfram Alpha does return zero. ...
6
votes
2answers
111 views

Sum considers RandomInteger[] as a constant

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

Is there an easy way to speed up this double summation in Mathematica

I would like to make an intensity plot of Bosons in a harmonic trapping potential. Hence, I would like to execute the following double summation (everything made dimensionless) for as many terms as ...
6
votes
2answers
213 views

Solve a system of M equations without specifying M [on hold]

I am trying to write my game-theoretic model in Wolfram Language. There is only one remaining step and I am not sure if it is within reach of Wolfram Language (or Mathematica). I describe a simplified ...
6
votes
0answers
75 views

What is the underlying algorithm to simplify sums of reciprocals of polynomials?

Flipping through Wolfram's blog entry on Leibniz, W noted Huygens' interview test for the young Leibniz, namely to determine: $$ \sum_{n\ge2} \frac{1}{{n \choose 2}} $$ It's one thing to do this by ...
5
votes
3answers
240 views

Make a vector of sums of matrix rows

I have a matrix in Mathematica: ...
5
votes
3answers
288 views

The speed of Sum[] varies strangely

I was curious about the difference in speed between Total and Sum. I found out Total was ...
5
votes
3answers
436 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 ...