How to resolve the algorithm Fibonacci word step by step in the PARI/GP programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Fibonacci word step by step in the PARI/GP programming language

Table of Contents

Problem Statement

The   Fibonacci Word   may be created in a manner analogous to the   Fibonacci Sequence   as described here:

Perform the above steps for     n = 37. You may display the first few but not the larger values of   n. {Doing so will get the task's author into trouble with them what be (again!).} Instead, create a table for   F_Words   1   to   37   which shows:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Fibonacci word step by step in the PARI/GP programming language

Source code in the pari/gp programming language

ent(a,b)=[a,b]=[a,b]/(a+b);(a*log(if(a,a,1))+b*log(if(b,b,1)))/log(1/2)
allocatemem(75<<20) \\ Allocate 75 MB stack space
F=vector(37);F[1]="1";F[2]="0";for(n=3,37,F[n]=Str(F[n-1],F[n-2]))
for(n=1,37,print(n" "fibonacci(n)" "ent(fibonacci(n-1),fibonacci(n-2))))

  

You may also check:How to resolve the algorithm Literals/Floating point step by step in the zkl programming language
You may also check:How to resolve the algorithm Church numerals step by step in the Tailspin programming language
You may also check:How to resolve the algorithm Unbias a random generator step by step in the BASIC programming language
You may also check:How to resolve the algorithm Look-and-say sequence step by step in the Ursala programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the Picat programming language