How to resolve the algorithm Bernoulli numbers step by step in the GAP programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Bernoulli numbers step by step in the GAP programming language
Table of Contents
Problem Statement
Bernoulli numbers are used in some series expansions of several functions (trigonometric, hyperbolic, gamma, etc.), and are extremely important in number theory and analysis. Note that there are two definitions of Bernoulli numbers; this task will be using the modern usage (as per The National Institute of Standards and Technology convention). The nth Bernoulli number is expressed as Bn.
The Akiyama–Tanigawa algorithm for the "second Bernoulli numbers" as taken from wikipedia is as follows:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Bernoulli numbers step by step in the GAP programming language
Source code in the gap programming language
for a in Filtered(List([0 .. 60], n -> [n, Bernoulli(n)]), x -> x[2] <> 0) do
Print(a, "\n");
od;
[ 0, 1 ]
[ 1, -1/2 ]
[ 2, 1/6 ]
[ 4, -1/30 ]
[ 6, 1/42 ]
[ 8, -1/30 ]
[ 10, 5/66 ]
[ 12, -691/2730 ]
[ 14, 7/6 ]
[ 16, -3617/510 ]
[ 18, 43867/798 ]
[ 20, -174611/330 ]
[ 22, 854513/138 ]
[ 24, -236364091/2730 ]
[ 26, 8553103/6 ]
[ 28, -23749461029/870 ]
[ 30, 8615841276005/14322 ]
[ 32, -7709321041217/510 ]
[ 34, 2577687858367/6 ]
[ 36, -26315271553053477373/1919190 ]
[ 38, 2929993913841559/6 ]
[ 40, -261082718496449122051/13530 ]
[ 42, 1520097643918070802691/1806 ]
[ 44, -27833269579301024235023/690 ]
[ 46, 596451111593912163277961/282 ]
[ 48, -5609403368997817686249127547/46410 ]
[ 50, 495057205241079648212477525/66 ]
[ 52, -801165718135489957347924991853/1590 ]
[ 54, 29149963634884862421418123812691/798 ]
[ 56, -2479392929313226753685415739663229/870 ]
[ 58, 84483613348880041862046775994036021/354 ]
[ 60, -1215233140483755572040304994079820246041491/56786730 ]
You may also check:How to resolve the algorithm Define a primitive data type step by step in the Haskell programming language
You may also check:How to resolve the algorithm Discordian date step by step in the Batch File programming language
You may also check:How to resolve the algorithm Magic squares of singly even order step by step in the 11l programming language
You may also check:How to resolve the algorithm Temperature conversion step by step in the Arturo programming language
You may also check:How to resolve the algorithm Ludic numbers step by step in the VBScript programming language