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
37
votes
2answers
837 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 ...
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 ...
22
votes
3answers
488 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 ...
20
votes
1answer
298 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 ...
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 ...
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 ...
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 ...
17
votes
2answers
16k 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}^\...
15
votes
1answer
370 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 ...
15
votes
3answers
417 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
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'...
14
votes
2answers
481 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
1answer
286 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 ...
13
votes
5answers
1k 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 ...
13
votes
3answers
492 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}] ...
12
votes
3answers
855 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
2answers
480 views

Summation bug in 11.2

If I sum all the positive-numbered Fourier coefficients of $\cos(x)$, I get the correct answer. If I sum the negative-numbered ones, I get a wrong answer. Splitting the sum into two parts somehow ...
12
votes
3answers
546 views

The speed of Sum[] varies strangely

I was curious about the difference in speed between Total and Sum. I found out Total was ...
12
votes
2answers
368 views

Evaluating a symbolic sum

I have read how Mathematica does not have an easy time with symbolic sums, but nevertheless would like to know if anyone can suggest an approach to help Mathematica along. For: ...
12
votes
2answers
590 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[...
12
votes
3answers
610 views

How can we simplify equivalent sums over different index variables?

The following should be True for any function x: ...
11
votes
5answers
11k 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 ...
11
votes
6answers
533 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
4answers
411 views

Finite sum not evaluating

Mathematica refuses to evaluate this summation. Sum[2^(k + 1)^3 - 2^(k - 1)^3, {k, 0, n}] It just returns the form unevaluated. $\sum _{k=0}^n \left(2^{(k+1)^...
11
votes
2answers
208 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
1answer
216 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 ...
11
votes
0answers
101 views

What does that output of Sum mean?

I made the computation ClearAll["Global`*"]; r = Sum[1/2^(k*n/(k + n)), {k, 1, 2*n}, Assumptions -> n ∈ Integers && n > 0] and got ...
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 $...
10
votes
5answers
698 views

Possible bug in infinite sum Sum[(Sin[k]/k)^m,{k,0,∞}]

EDIT 11.10.2017 In order to avoid confusion which might arise from the statements I made in this question I declare here that the extensive discussion here has shown that the described behaviour is ...
10
votes
2answers
516 views

Bug in splitting sum

Bug persisting through version 11.2.0 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-...
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: ...
10
votes
3answers
491 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
1answer
157 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 ...
10
votes
2answers
507 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 ...
10
votes
1answer
2k 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
8answers
582 views

How to find the sum for each individual row in a binary matrix until the first zero is reached from left to right.

I have a 150 by 300 binary matrix. I would like to sum the 1's for each individual row (from left to right) until the first zero is encountered. For example, if a given row is 1 1 1 1 1 1 0 0 0 1 0 0 ...
9
votes
3answers
299 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 ...
9
votes
2answers
733 views

RootSum result manipulation/simplification

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

Problem with simplification KroneckerDelta

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

Wolfram says sum diverges, but Mathematica gives a numerical value for infinite sum [closed]

Take this sum for example: $$\sum_{n=2}^\infty\frac1{\log(n!)}$$ Wolfram says that this does not converge by the comparison test. However, when I use Mathematica's ...
8
votes
5answers
3k 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
485 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
2answers
337 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
2answers
580 views

What is wrong with my use of Summation?

I want to compute $r$ according to the following code: ...
8
votes
1answer
359 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: ...
8
votes
1answer
396 views

Error in infinite sum [duplicate]

The binary weight of the non negative integer k is defined by w[k_] := Total[IntegerDigits[k, 2]] The first values are (cf. http://oeis.org/ A000120) ...
8
votes
3answers
314 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 ...
8
votes
1answer
376 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? ...
8
votes
1answer
1k views

Understanding Dirichlet regularization in Sum

I've tried to calculate few classic sums using Dirichlet regularization: ...

1 2 3 4 5 14