Math-PlanePath-Toothpick

 view release on metacpan or  search on metacpan

devel/lib/Math/PlanePath/ToothpickTreeByCells-oeis.t  view on Meta::CPAN

     return \@got;
   });

#------------------------------------------------------------------------------
# A160158 - two toothpicks end-to-end

MyOEIS::compare_values
  (anum => 'A160158',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'two_horiz');
     my @got;
     my $total = 0;
     for (my $depth = 0; @got < $count; $depth++) {
       push @got, $path->tree_depth_to_n($depth);
     }
     return \@got;
   });

# added
MyOEIS::compare_values
  (anum => 'A160159',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'two_horiz');
     my @got;
     my $total = 0;
     for (my $depth = 0; @got < $count; $depth++) {
       push @got, $path->tree_depth_to_width($depth);
     }
     return \@got;
   });


#------------------------------------------------------------------------------
# A160406 - wedge total cells
# http://www.polprimos.com/imagenespub/poltp406.jpg

MyOEIS::compare_values
  (anum => 'A160406',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'wedge');
     my @got;
     my $total = 0;
     for (my $depth = 0; @got < $count; $depth++) {
       push @got, $path->tree_depth_to_n($depth);
     }
     return \@got;
   });

# sub full_from_wedge {
#   my ($n) = @_;
#   return 2*wedge(n) + 2*a(n+1) - 4n - 1 for n>0. - N. J. A.      
# 
# }
# use Memoize;
# BEGIN { Memoize::memoize('wedge_formula'); }

#------------------------------------------------------------------------------
# A170890 - unwedge_down_W total cells

MyOEIS::compare_values
  (anum => 'A170890',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'unwedge_down_W');
     my @got;
     my $total = 0;
     for (my $depth = 0; @got < $count; $depth++) {
       push @got, $path->tree_depth_to_n($depth);
     }
     return \@got;
   });

# A170891 - unwedge_down_W added
MyOEIS::compare_values
  (anum => 'A170891',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'unwedge_down_W');
     my @got = (0);
     for (my $depth = 0; @got < $count; $depth++) {
       my $added = ($path->tree_depth_to_n($depth+1)
                    - $path->tree_depth_to_n($depth));
       push @got, $added;
     }
     return \@got;
   });

#------------------------------------------------------------------------------
# A170894 - unwedge_left_S total cells

MyOEIS::compare_values
  (anum => 'A170894',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'unwedge_left_S');
     my @got;
     my $total = 0;
     for (my $depth = 0; @got < $count; $depth++) {
       push @got, $path->tree_depth_to_n($depth);
     }
     return \@got;
   });

# A170895 - unwedge_left_S added
MyOEIS::compare_values
  (anum => 'A170895',
   max_count => $max_count,
   func => sub {
     my ($count) = @_;
     my $path = Math::PlanePath::ToothpickTreeByCells->new (parts => 'unwedge_left_S');
     my @got = (0);
     for (my $depth = 0; @got < $count; $depth++) {



( run in 1.574 second using v1.01-cache-2.11-cpan-39bf76dae61 )