Please how can I calculate the values of this finite sum of numbers in fully sequential , I'm finding it difficult

Answers (3)

Hello,
You can try something like this:
n=1000; %Specify your n
SUM=zeros(n,1);
for i=1:n;
SUM(i)=1./i^4;
end
value=sum(SUM); %This is the result of your sum

8 Comments

Why do you name the summands of the series "SUM" ? That's quite misleading.
What do you mean by "sequential" in your question ? You mean you want to compute all partial sums up to a specified n ? Or - as @Antoni Garcia-Herreros did correctly - only evaluate the sum for a specified value of n ?
My guess is that they need to use a "for" or "while" loop, rather than a formula.
i have been able to get it done in fully sequential
i need help in implementing it for distribued using a parfor loop for different processors
im finding it hard to illustrate my equation in the parfor loop correctly
n=1000; %Specify your n
SUM=zeros(n,1);
parfor i=1:n;
SUM(i)=1./i^4;
end
value=sum(SUM); %This is the result of your sum

Sign in to comment.

Easy peasy.
sumof4thpowers = @(N) nchoosek(N+1,5) + 11*nchoosek(N+2,5) + 11*nchoosek(N+3,5) + nchoosek(N+4,5);
For example:
sumof4thpowers(4)
ans = 354
Was it correct?
1^4 + 2^4 + 3^4 + 4^4
ans = 354
Note that you asked only how to compute the sum, not how to derive the expresssion I gave. But they can be shown to be equivalent.
Example:
syms i n
symsum(i^(-7), i, 1, n)
ans = 
char(ans)
ans = 'zeta(7) + psi(6, n + 1)/720'

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2023a

Tags

Asked:

on 27 Mar 2023

Commented:

on 28 Mar 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!