Math-PlanePath

 view release on metacpan or  search on metacpan

lib/Math/NumSeq/PlanePathTurn.pm  view on Meta::CPAN

  use constant _NumSeq_Turn_Turn4_max => 3.5; # South-East diagonal
}
{ package Math::PlanePath::SierpinskiArrowheadCentres;
  use constant _NumSeq_Turn_Turn4_max => 3.5; # South-East diagonal
}
# { package Math::PlanePath::SierpinskiCurve;
# #   use constant _NumSeq_Turn_oeis_anum =>
# #   { 'arms=1' =>
# #     {
# #      # Not quite, A039963 numbered OFFSET=0 whereas first turn at N=1 here
# #      Right => 'A039963',  # duplicated KochCurve turns
# #     },
# #   },
# # }
# }
{ package Math::PlanePath::SierpinskiCurveStair;
  use constant _NumSeq_Turn_Turn4_min => 1; # never straight
}
{ package Math::PlanePath::DragonCurve;
  use constant _NumSeq_Turn_Turn4_min => 1; # left or right only
  use constant _NumSeq_Turn_oeis_anum =>
    { 'arms=1' =>
      {
       'LSR' => 'A034947', # Jacobi symbol (-1/n)
       # OEIS-Catalogue: A034947 planepath=DragonCurve turn_type=LSR

       Turn4 => 'A099545',  # (odd part of n) mod 4
       # OEIS-Catalogue: A099545 planepath=DragonCurve turn_type=Turn4

       # 'L1R0' => 'A014577', # left=1,right=0  OFFSET=0
       # 'L0R1' => 'A014707', # left=0,right=1  OFFSET=0
       # 'L1R2' => 'A014709', # left=1,right=2  OFFSET=0
       # 'L1R3' => 'A099545', # left=1,right=3  OFFSET=1

       #  # Not quite, A014707 has OFFSET=0 cf first elem for N=1
       #  Left => 'A014707', # turn, 1=left,0=right
       #  # OEIS-Catalogue: A014707 planepath=DragonCurve

       #  # Not quite, A014577 has OFFSET=0 cf first elem for N=1
       #  Right => 'A014577', # turn, 0=left,1=right
       #  # OEIS-Catalogue: A014577 planepath=DragonCurve turn_type=Right

       # Not quite A014709 OFFSET=0 vs first turn at N=1 here
       # SLR => 'A014709'
       # SRL => 'A014710',
      },
    };
}
{ package Math::PlanePath::DragonRounded;
  use constant _NumSeq_Turn_Turn4_min => 0.5;
  use constant _NumSeq_Turn_Turn4_max => 3.5;
}
# { package Math::PlanePath::DragonMidpoint;
# }
{ package Math::PlanePath::AlternatePaper;
  use constant _NumSeq_Turn_Turn4_min => 1; # left or right only

  # A209615 is (-1)^e for each p^e prime=4k+3 or prime=2
  # 3*3 mod 4 = 1 mod 4
  # so picks out bit above lowest 1-bit, and factor -1 if an odd power-of-2
  # which is the AlternatePaper turn formula
  #
  use constant _NumSeq_Turn_oeis_anum =>
    { 'arms=1' =>
      { LSR => 'A209615',
        # OEIS-Catalogue: A209615 planepath=AlternatePaper turn_type=LSR
        Right => 'A292077',
        # OEIS-Catalogue: A292077 planepath=AlternatePaper turn_type=Right

        # # Not quite, A106665 has OFFSET=0 cf first here i=1
        # 'Left' => 'A106665', # turn, 1=left,0=right
        # # OEIS-Catalogue: A106665 planepath=AlternatePaper i_offset=1
      },
    };
}
{ package Math::PlanePath::GosperSide;

  # Suspect not in OEIS:
  # Left or Right according to lowest non-zero ternary digit 1 or 2
  #
  use constant _NumSeq_Turn_oeis_anum =>
    { '' =>
      { Left => 'A137893', # turn, 1=left,0=right, OFFSET=1
        SLR  => 'A060236', # base-3 lowest non-zero digit 1=left,2=right
        # OEIS-Catalogue: A137893 planepath=GosperSide
        # OEIS-Other:     A137893 planepath=TerdragonCurve
        # OEIS-Catalogue: A060236 planepath=GosperSide turn_type=SLR
        # OEIS-Other:     A060236 planepath=TerdragonCurve turn_type=SLR
        # A060236 would also be a "TTurn3"

        # cf A136442 - a(3n)=1, a(3n-1)=0, a(3n+1)=a(n)
        # ternary lowest non-1  0->1 2->0

        # Not quite, A080846 OFFSET=0 values 0,1,0,0,1 which are N=1 here
        # Right => 'A080846',
        # # OEIS-Catalogue: A080846 planepath=GosperSide turn_type=Right
        # # OEIS-Other:     A080846 planepath=TerdragonCurve turn_type=Right
        # Or A189640 has extra initial 0.
      },
    };
}
{ package Math::PlanePath::TerdragonCurve;
  # GosperSide and TerdragonCurve same turn sequence, by diff angles
  use constant _NumSeq_Turn_Turn4_min => 1;
  use constant _NumSeq_Turn_Turn4_max => 3;
  use constant _NumSeq_Turn_oeis_anum =>
    { 'arms=1' => Math::PlanePath::GosperSide->_NumSeq_Turn_oeis_anum->{''} };
}
{ package Math::PlanePath::TerdragonRounded;
  use constant _NumSeq_Turn_Turn4_min => 0.5;
  use constant _NumSeq_Turn_Turn4_max => 3.5;
}
{ package Math::PlanePath::TerdragonMidpoint;
  use constant _NumSeq_Turn_Turn4_max => 3;
}
{ package Math::PlanePath::AlternateTerdragon;
  use constant _NumSeq_Turn_Turn4_min => 1;
  use constant _NumSeq_Turn_Turn4_max => 3;
  # use constant _NumSeq_Turn_oeis_anum =>
  #   { 'arms=1' =>
  #     {



( run in 1.280 second using v1.01-cache-2.11-cpan-df04353d9ac )