How to resolve the algorithm Sum of a series step by step in the langur programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Sum of a series step by step in the langur programming language

Table of Contents

Problem Statement

Compute the   nth   term of a series,   i.e. the sum of the   n   first terms of the corresponding sequence.
Informally this value, or its limit when   n   tends to infinity, is also called the sum of the series, thus the title of this task. For this task, use:

This approximates the   zeta function   for   S=2,   whose exact value is the solution of the Basel problem.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sum of a series step by step in the langur programming language

Source code in the langur programming language

writeln "calc.: ", fold f{+}, map f 1/.x^2, 1..1000
writeln "exact: ", pi^2/6

mode divMaxScale = 100

writeln "calc.: ", fold f{+}, map f 1/.x^2, 1..1000
writeln "exact: ", pi^2/6

  

You may also check:How to resolve the algorithm LZW compression step by step in the Scheme programming language
You may also check:How to resolve the algorithm Bitmap/Bézier curves/Quadratic step by step in the Commodore Basic programming language
You may also check:How to resolve the algorithm HTTPS/Authenticated step by step in the LiveCode programming language
You may also check:How to resolve the algorithm Substring step by step in the Nemerle programming language
You may also check:How to resolve the algorithm Factorions step by step in the AWK programming language