function number = polyiamond_free_enumerate ( order )

%*****************************************************************************80
%
%% polyiamond_free_enumerate() counts free polyiamonds of a given order.
%
%  Discussion:
%
%    Holes are allowed.  Turning over is allowed.
%
%    This is sequence A000577 from the online encyclopedia of 
%    integer sequences.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 August 2020
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Solomon Golomb,
%    Polyominoes: Puzzles, Patterns, Problems, and Packings,
%    Princeton University Press, 1996,
%    ISBN: 9780691024448
%
%    Neil Sloane, Simon Plouffe, 
%    The Encyclopedia of Integer Sequences, 
%    Academic Press, 1995.
%
%  Input:
%
%    integer ORDER, the order of a polyiamond, between 0 and 30.
%
%  Output:
%
%    integer NUMBER, the number of polyiamonds of this order.
%
  number_vec = [  ...
    1, ...
    1, 1, 1, 3, 4, ...
    12, 24, 66, 160, 448, ...
    1186, 3334, 9235, 26166, 73983, ...
    211297, 604107, 1736328, 5000593, 14448984, ...
    41835738, 121419260, 353045291, 1028452717, 3000800627, ...
    8769216722, 25661961898, 75195166667, 220605519559, 647943626796 ];

  if ( 0 <= order && order <= 30 )
    number = number_vec(order+1);
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 'polyiamond_enumerate - Fatal error!\n' );
    fprintf ( 1, '  0 <= order <= 30 is required.\n' );
    fprintf ( 1, '  Input value was order = %d\n', order );
    error ( 'polyiamond_enumerate - Fatal error!' );
  end

  return
end

