필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)

답변 (3개)

Antoni Garcia-Herreros
Antoni Garcia-Herreros 2023년 3월 27일
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
Walter Roberson
Walter Roberson 2023년 3월 28일
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

댓글을 달려면 로그인하십시오.


John D'Errico
John D'Errico 2023년 3월 27일
편집: John D'Errico 2023년 3월 27일
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.

Walter Roberson
Walter Roberson 2023년 3월 27일
편집: Walter Roberson 2023년 3월 27일
Example:
syms i n
symsum(i^(-7), i, 1, n)
ans = 
char(ans)
ans = 'zeta(7) + psi(6, n + 1)/720'

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by