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


fibword: procedure options (main);  /* 9 October 2013 */
   declare (fn, fnp1, fibword) bit (32000) varying;
   declare (i, ln, lnp1, lfibword) fixed binary(31);
 
   fn = '1'b; fnp1 = '0'b; ln, lnp1 = 1;
   put skip edit (1, length(fn), fn)     (f(2), f(10), x(1), b);
   put skip edit (2, length(fnp1), fnp1) (f(2), f(10), x(1), b);
   do i = 3 to 37;
      lfibword = lnp1 + ln;
      ln = lnp1;
      lnp1 = lfibword;
      if i <= 10 then
         do;
            fibword = fnp1 || fn;
            put skip edit (i, length(fibword), fibword) (f(2), f(10), x(1), b);
            fn = fnp1; fnp1 = fibword;
         end;
      else
         do;
            put skip edit (i, lfibword) (f(2), f(10));
         end;
   end;
 
end fibword;