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

    Define   F_Word1   as   1
    Define   F_Word2   as   0
    Form     F_Word3   as   F_Word2     concatenated with   F_Word1    i.e.:   01
    Form     F_Wordn   as   F_Wordn-1   concatenated with   F_wordn-2



Task

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:

   The number of characters in the word
   The word's Entropy


Related tasks
 
   Fibonacci word/fractal
   Entropy
   Entropy/Narcissist


procedure main(A)
    n := integer(A[1]) | 37
    write(right("N",4)," ",right("length",15)," ",left("Entrophy",15)," ",
          " Fibword")
    every w := fword(i := 1 to n) do {
        writes(right(i,4)," ",right(*w,15)," ",left(H(w),15))
        if i <= 8 then write(": ",w) else write()
        }
end
 
procedure fword(n)
    static fcache
    initial fcache := table()
    /fcache[n] := case n of {
                     1: "1"
                     2: "0"
                     default: fword(n-1)||fword(n-2)
                     }
    return fcache[n]
end
 
procedure H(s)
    P := table(0.0)
    every P[!s] +:= 1.0/*s
    every (h := 0.0) -:= P[c := key(P)] * log(P[c],2)
    return h
end