NumSeq/PlanePathN.pm untested

filter: Statementstmt 0.0% 0 / 2136 Branchbran 0.0% 0 / 66 Conditioncond 0.0% 0 / 117 MC/DCmcdc 0.0% 0 / 72 Subroutinesub 0.0% 0 / 629 Podpod 0.0% 0 / 75 totaltotal 0.0% 0 / 3095 CC 34 SCAR 10.0
CC
34
Cov
0%
oeis_anum
30.0
_NumSeq_Diagonal_increasing
20.0
new
12.0
CRAP 2.7
1 # Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde
2  
3 # This file is part of Math-PlanePath.
4 #
5 # Math-PlanePath is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 3, or (at your option) any later
8 # version.
9 #
10 # Math-PlanePath is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with Math-PlanePath. If not, see <http://www.gnu.org/licenses/>.
17  
18  
19 # Maybe:
20 # "Turn" N of turn positions
21 # $path->n_next_turn($n)
22  
23  
24 package Math::NumSeq::PlanePathN;
25 use 5.004;
26 use strict;
27 use Carp 'croak';
28 use constant 1.02;
29  
30 use vars '$VERSION','@ISA';
31 $VERSION = 129;
32 use Math::NumSeq;
33 @ISA = ('Math::NumSeq');
34  
35 use Math::NumSeq::PlanePathCoord;
36  
37 # uncomment this to run the ### lines
38 # use Smart::Comments;
39  
40  
41 sub description {
42 my ($self) = @_;
43 if (ref $self) {
44 return "N values on $self->{'line_type'} of path $self->{'planepath'}";
45 } else {
46 # class method
47 return 'N values from a PlanePath';
48 }
49 }
50  
51 use constant::defer parameter_info_array =>
52 sub {
53 return [
54 Math::NumSeq::PlanePathCoord::_parameter_info_planepath(),
55  
56 { name => 'line_type',
57 display => 'Line Type',
58 type => 'enum',
59 default => 'X_axis',
60 choices => ['X_axis',
61 'Y_axis',
62 'X_neg',
63 'Y_neg',
64 'Diagonal',
65 'Diagonal_NW',
66 'Diagonal_SW',
67 'Diagonal_SE',
68 'Depth_start',
69 'Depth_end',
70 ],
71 description => 'The axis or line to take path N values from.',
72 },
73 ];
74 };
75  
76 #------------------------------------------------------------------------------
77  
78 my %oeis_anum =
79 (
80 # MultipleRings,step=0 -- integers 1,2,3, etc, but starting i=0
81 );
82  
83 sub oeis_anum {
84 my ($self) = @_;
85 ### PlanePathN oeis_anum() ...
86  
87 my $planepath_object = $self->{'planepath_object'};
88 {
89 my $key = Math::NumSeq::PlanePathCoord::_planepath_oeis_anum_key($self->{'planepath_object'});
90 my $i_start = $self->i_start;
91 if ($i_start != $self->default_i_start) {
92 ### $i_start
93 ### cf n_start: $planepath_object->n_start
94 $key .= ",i_start=$i_start";
95 }
96  
97 ### planepath: ref $planepath_object
98 ### $key
99 ### whole table: $planepath_object->_NumSeq_N_oeis_anum
100 ### key href: $planepath_object->_NumSeq_N_oeis_anum->{$key}
101  
102 if (my $anum = $planepath_object->_NumSeq_N_oeis_anum->{$key}->{$self->{'line_type'}}) {
103 return $anum;
104 }
105 if (my $anum = $planepath_object->_NumSeq_N_oeis_all_anum->{$self->{'line_type'}}) {
106 return $anum;
107 }
108 }
109 {
110 my $key = Math::NumSeq::PlanePathCoord::_planepath_oeis_key($planepath_object);
111 my $i_start = $self->i_start;
112 if ($i_start != $self->default_i_start) {
113 ### $i_start
114 ### cf n_start: $planepath_object->n_start
115 $key .= ",i_start=$i_start";
116 }
117 ### $key
118 ### hash: $oeis_anum{$key}
119 return $oeis_anum{$key}->{$self->{'line_type'}};
120 }
121 }
122  
123 #------------------------------------------------------------------------------
124  
125 sub default_i_start {
126 my ($self) = @_;
127  
128 my $planepath_object = $self->{'planepath_object'}
129 # nasty hack allow no 'planepath_object' when SUPER::new() calls rewind()
130 || return 0;
131  
132 my $method = "_NumSeq_$self->{'line_type'}_i_start";
133 if (my $func = $planepath_object->can($method)) {
134 return $planepath_object->$func();
135 }
136 return 0;
137 }
138 sub new {
139 my $self = shift->SUPER::new(@_);
140  
141 my $planepath_object = ($self->{'planepath_object'}
142 ||= Math::NumSeq::PlanePathCoord::_planepath_name_to_object($self->{'planepath'}));
143 ### $planepath_object
144  
145 my $line_type = $self->{'line_type'};
146  
147 ### i_func name: "i_func_$line_type"
148 $self->{'i_func'}
149 = $self->can("i_func_$line_type")
150 || croak "Unrecognised line_type: ",$line_type;
151  
152 $self->{'pred_func'}
153 = $self->can("pred_func_$line_type")
154 || croak "Unrecognised line_type: ",$line_type;
155  
156 if (my $func
157 = $planepath_object->can("_NumSeq_${line_type}_step")) {
158 $self->{'i_step'} = $planepath_object->$func();
159 } elsif ($planepath_object->_NumSeq_A2()
160 && ($line_type eq 'X_axis'
161 || $line_type eq 'Y_axis'
162 || $line_type eq 'X_neg'
163 || $line_type eq 'Y_neg')) {
164 $self->{'i_step'} = 2;
165 } else {
166 $self->{'i_step'} = 1;
167 }
168 ### i_step: $self->{'i_step'}
169  
170 # for use in pred()
171 $self->{'i_start'} = $self->i_start;
172  
173 $self->rewind;
174 return $self;
175 }
176  
177 sub rewind {
178 my ($self) = @_;
179 $self->{'i'} = $self->i_start;
180 }
181  
182 sub next {
183 my ($self) = @_;
184 ### NumSeq-PlanePathN next(): "i=$self->{'i'}"
185  
186 my $i = $self->{'i'};
187 my $n = &{$self->{'i_func'}} ($self, $i);
188 ### $n
189 if (! defined $n) {
190 ### i_func returns undef, no value ...
191 return;
192 }
193 # secret experimental automatic bigint to preserve precision
194 if (! ref $n && $n > 0xFF_FFFF) {
195 $n = &{$self->{'i_func'}}($self,_to_bigint($i));
196 }
197 return ($self->{'i'}++, $n);
198 }
199 sub _to_bigint {
200 my ($n) = @_;
201 # stringize to avoid UV->BigInt bug in Math::BigInt::GMP version 1.37
202 return _bigint()->new("$n");
203 }
204 # or maybe check for new enough for uv->mpz fix
205 use constant::defer _bigint => sub {
206 # no choice of back-end here, leave that to the mainline
207 require Math::BigInt;
208 return 'Math::BigInt';
209 };
210  
211 sub ith {
212 my ($self, $i) = @_;
213 ### NumSeq-PlanePathN ith(): $i
214 return &{$self->{'i_func'}}($self, $i);
215 }
216  
217 sub i_func_X_axis {
218 my ($self, $i) = @_;
219 my $path_object = $self->{'planepath_object'};
220 return $path_object->xy_to_n ($i * $self->{'i_step'},
221 $path_object->_NumSeq_X_axis_at_Y);
222 }
223 sub i_func_Y_axis {
224 my ($self, $i) = @_;
225 ### i_func_Y_axis(): "i=$i"
226 ### X: $self->{'planepath_object'}->_NumSeq_Y_axis_at_X
227 ### Y: $i * $self->{'i_step'}
228 my $path_object = $self->{'planepath_object'};
229 return $path_object->xy_to_n ($path_object->_NumSeq_Y_axis_at_X,
230 $i * $self->{'i_step'});
231 }
232 sub i_func_X_neg {
233 my ($self, $i) = @_;
234 ### i_func_X_neg(): $i
235 my $path_object = $self->{'planepath_object'};
236 return $path_object->xy_to_n (-$i * $self->{'i_step'},
237 $path_object->_NumSeq_X_axis_at_Y);
238 }
239 sub i_func_Y_neg {
240 my ($self, $i) = @_;
241 my $path_object = $self->{'planepath_object'};
242 return $path_object->xy_to_n ($path_object->_NumSeq_Y_axis_at_X,
243 - $i * $self->{'i_step'});
244 }
245 sub i_func_Diagonal {
246 my ($self, $i) = @_;
247 my $path_object = $self->{'planepath_object'};
248 return $path_object->xy_to_n ($i + $path_object->_NumSeq_Diagonal_X_offset,
249 $i);
250 }
251 sub i_func_Diagonal_NW {
252 my ($self, $i) = @_;
253 my $path_object = $self->{'planepath_object'};
254 return $path_object->xy_to_n (-$i + $path_object->_NumSeq_Diagonal_X_offset,
255 $i);
256 }
257 sub i_func_Diagonal_SW {
258 my ($self, $i) = @_;
259 my $path_object = $self->{'planepath_object'};
260 return $path_object->xy_to_n (-$i + $path_object->_NumSeq_Diagonal_X_offset,
261 -$i);
262 }
263 sub i_func_Diagonal_SE {
264 my ($self, $i) = @_;
265 my $path_object = $self->{'planepath_object'};
266 return $path_object->xy_to_n ($i + $path_object->_NumSeq_Diagonal_X_offset,
267 -$i);
268 }
269  
270 sub i_func_Depth_start {
271 my ($self, $i) = @_;
272 ### i_func_Depth_start(): "i=$i"
273 return $self->{'planepath_object'}->tree_depth_to_n($i);
274 }
275 sub i_func_Depth_end {
276 my ($self, $i) = @_;
277 return $self->{'planepath_object'}->tree_depth_to_n_end($i);
278 }
279  
280 #------------------------------------------------------------------------------
281  
282 sub pred {
283 my ($self, $value) = @_;
284 ### PlanePathN pred(): $value
285 my $planepath_object = $self->{'planepath_object'};
286 unless ($value == int($value)) {
287 return 0;
288 }
289 my ($x,$y) = $planepath_object->n_to_xy($value)
290 or return 0;
291 return &{$self->{'pred_func'}} ($self, $x,$y, $value);
292 }
293 sub pred_func_X_axis {
294 my ($self, $x,$y) = @_;
295 return ($x >= $self->{'i_start'}
296 && $y == $self->{'planepath_object'}->_NumSeq_X_axis_at_Y);
297 }
298 sub pred_func_Y_axis {
299 my ($self, $x,$y) = @_;
300 return ($x == $self->{'planepath_object'}->_NumSeq_Y_axis_at_X
301 && $y >= $self->{'i_start'});
302 }
303 sub pred_func_X_neg {
304 my ($self, $x,$y) = @_;
305 return ($x <= - $self->{'i_start'} && $y == 0);
306 }
307 sub pred_func_Y_neg {
308 my ($self, $x,$y) = @_;
309 return ($x == 0 && $y <= - $self->{'i_start'});
310 }
311 sub pred_func_Diagonal {
312 my ($self, $x,$y) = @_;
313 $x -= $self->{'planepath_object'}->_NumSeq_Diagonal_X_offset;
314 return ($x >= $self->{'i_start'} && $x == $y);
315 }
316 sub pred_func_Diagonal_NW {
317 my ($self, $x,$y) = @_;
318 return ($x <= - $self->{'i_start'} && $x == -$y);
319 }
320 sub pred_func_Diagonal_SW {
321 my ($self, $x,$y) = @_;
322 return ($x <= - $self->{'i_start'} && $x == $y);
323 }
324 sub pred_func_Diagonal_SE {
325 my ($self, $x,$y) = @_;
326 return ($x >= $self->{'i_start'} && $x == -$y);
327 }
328  
329 sub pred_func_Depth_start {
330 my ($self, $x,$y, $n) = @_;
331 return path_tree_n_is_depth_start($self->{'planepath_object'}, $n);
332 }
333 sub pred_func_Depth_end {
334 my ($self, $x,$y, $n) = @_;
335 return path_tree_n_is_depth_end($self->{'planepath_object'}, $n);
336 }
337  
338 # Return true if $n is the start of a depth level.
339 sub path_tree_n_is_depth_start {
340 my ($path, $n) = @_;
341 my $depth = $path->tree_n_to_depth($n);
342 return (defined $depth && $n == $path->tree_depth_to_n($depth));
343 }
344 # Return true if $n is the end of a depth level.
345 sub path_tree_n_is_depth_end {
346 my ($path, $n) = @_;
347 my $depth = $path->tree_n_to_depth($n);
348 return (defined $depth && $n == $path->tree_depth_to_n_end($depth));
349 }
350  
351 #------------------------------------------------------------------------------
352  
353 use constant characteristic_integer => 1; # integer Ns
354  
355 sub characteristic_increasing {
356 my ($self) = @_;
357 ### PlanePathN characteristic_increasing(): $self
358  
359 my $method = "_NumSeq_$self->{'line_type'}_increasing";
360 my $planepath_object = $self->{'planepath_object'};
361  
362 ### planepath_object: ref $planepath_object
363 ### $method
364 ### can code: $planepath_object->can($method)
365 ### result: $planepath_object->can($method) && $planepath_object->$method()
366  
367 return $planepath_object->can($method) && $planepath_object->$method();
368 }
369 sub characteristic_increasing_from_i {
370 my ($self) = @_;
371 ### PlanePathN characteristic_increasing_from_i(): $self
372  
373 my $planepath_object = $self->{'planepath_object'};
374 my $method = "_NumSeq_$self->{'line_type'}_increasing_from_i";
375 ### $method
376  
377 if ($method = $planepath_object->can($method)) {
378 ### can: $method
379 return $planepath_object->$method();
380 }
381 return ($self->characteristic('increasing')
382 ? $self->i_start
383 : undef);
384 }
385  
386 sub characteristic_non_decreasing {
387 my ($self) = @_;
388 ### PlanePathN characteristic_non_decreasing() ...
389 my $planepath_object = $self->{'planepath_object'};
390 my $method = "_NumSeq_$self->{'line_type'}_non_decreasing";
391 return (($planepath_object->can($method) && $planepath_object->$method())
392 || $self->characteristic_increasing);
393 }
394  
395 sub values_min {
396 my ($self) = @_;
397 ### PlanePathN values_min() ...
398 my $method = "_NumSeq_$self->{'line_type'}_min";
399 my $planepath_object = $self->{'planepath_object'};
400 if (my $coderef = $planepath_object->can($method)) {
401 ### $coderef
402 return $planepath_object->$coderef();
403 }
404 return $self->ith($self->i_start);
405 }
406 sub values_max {
407 my ($self) = @_;
408 my $method = "_NumSeq_$self->{'line_type'}_max";
409 my $planepath_object = $self->{'planepath_object'};
410 if (my $coderef = $planepath_object->can($method)) {
411 return $planepath_object->$coderef();
412 }
413 return undef;
414 }
415  
416 { package Math::PlanePath;
417 sub _NumSeq_X_axis_i_start {
418 my ($self) = @_;
419 my $x_minimum = $self->x_minimum;
420 if (defined $x_minimum && $x_minimum > 0) {
421 return int($x_minimum);
422 }
423 return 0;
424 }
425 sub _NumSeq_Y_axis_i_start {
426 my ($self) = @_;
427 ### _NumSeq_Y_axis_i_start() ...
428 my $y_minimum = $self->y_minimum;
429 if (defined $y_minimum && $y_minimum > 0) {
430 return int($y_minimum);
431 }
432 return 0;
433 }
434 sub _NumSeq_Y_axis_at_X {
435 my ($self) = @_;
436 my $x_minimum = $self->x_minimum;
437 if (defined $x_minimum && $x_minimum > 0) {
438 return $x_minimum;
439 }
440 return 0;
441 }
442 sub _NumSeq_X_axis_at_Y {
443 my ($self) = @_;
444 my $y_minimum = $self->y_minimum;
445 if (defined $y_minimum && $y_minimum > 0) {
446 return $y_minimum;
447 }
448 return 0;
449 }
450  
451 # i_start = Xminimum - Xoffset
452 # gives Xstart = i_start + Xoffset = Xminimum to start at Xminimum
453 use List::Util;
454 sub _NumSeq_Diagonal_i_start {
455 my ($self) = @_;
456 my $x_minimum = $self->x_minimum;
457 my $y_minimum = $self->y_minimum;
458 return List::Util::max
459 (int(($x_minimum||0) - $self->_NumSeq_Diagonal_X_offset),
460 int($y_minimum||0),
461 0);
462 }
463 use constant _NumSeq_Diagonal_X_offset => 0;
464 use constant _NumSeq_N_oeis_anum => {};
465 use constant _NumSeq_N_oeis_all_anum => {};
466 use constant _NumSeq_Depth_start_increasing => 1;
467 use constant _NumSeq_Depth_end_increasing => 1;
468  
469 # sub _NumSeq_pred_X_axis {
470 # my ($path, $value) = @_;
471 # return ($value == int($value)
472 # && ($path->x_negative || $value >= 0));
473 # }
474 # sub _NumSeq_pred_Y_axis {
475 # my ($path, $value) = @_;
476 # return ($value == int($value)
477 # && ($path->y_negative || $value >= 0));
478 # }
479 }
480  
481 { package Math::PlanePath::SquareSpiral;
482 use constant _NumSeq_X_axis_increasing => 1;
483 use constant _NumSeq_Y_axis_increasing => 1;
484 sub _NumSeq_X_neg_increasing {
485 my ($self) = @_;
486 return ($self->{'wider'} == 0);
487 }
488 sub _NumSeq_X_neg_increasing_from_i {
489 my ($self) = @_;
490 ### SquareSpiral _NumSeq_X_neg_increasing_from_i(): $self
491 # wider=0 from X=0
492 # wider=1 from X=-1
493 # wider=2 from X=-1
494 return int(($self->{'wider'}+1)/2);
495 }
496 use constant _NumSeq_Y_neg_increasing => 1;
497 use constant _NumSeq_Diagonal_increasing => 1;
498 use constant _NumSeq_Diagonal_NW_increasing => 1;
499 use constant _NumSeq_Diagonal_SW_increasing => 1;
500 use constant _NumSeq_Diagonal_SE_increasing => 1;
501  
502 sub _NumSeq_X_neg_min { # not the value at X=0,Y=0 if wider>0
503 my ($self) = @_;
504 return $self->n_start;
505 }
506  
507 use constant _NumSeq_N_oeis_anum =>
508 { 'wider=0,n_start=1' =>
509 { X_axis => 'A054552', # spoke E, 4n^2 - 3n + 1
510 Y_neg => 'A033951', # spoke S, 4n^2 + 3n + 1
511 Diagonal_NW => 'A053755', # 4n^2 + 1
512 Diagonal_SE => 'A016754', # (2n+1)^2
513 # OEIS-Catalogue: A054552 planepath=SquareSpiral
514 # OEIS-Catalogue: A033951 planepath=SquareSpiral line_type=Y_neg
515 # OEIS-Catalogue: A053755 planepath=SquareSpiral line_type=Diagonal_NW
516 # OEIS-Catalogue: A016754 planepath=SquareSpiral line_type=Diagonal_SE
517 #
518 # OEIS-Other: A054552 planepath=GreekKeySpiral,turns=0
519 # OEIS-Other: A033951 planepath=GreekKeySpiral,turns=0 line_type=Y_neg
520 # OEIS-Other: A053755 planepath=GreekKeySpiral,turns=0 line_type=Diagonal_NW
521 # OEIS-Other: A016754 planepath=GreekKeySpiral,turns=0 line_type=Diagonal_SE
522  
523 # Not quite, these have OFFSET=1 whereas path start X=0
524 # # Y_axis => 'A054556', # spoke N
525 # # X_neg => 'A054567', # spoke W
526 # # Diagonal => 'A054554', # spoke NE
527 # # Diagonal_SW => 'A054569', # spoke NE
528 # # # OEIS-Catalogue: A054556 planepath=SquareSpiral line_type=Y_axis
529 # # # OEIS-Catalogue: A054554 planepath=SquareSpiral line_type=Diagonal
530 },
531 'wider=0,n_start=0' =>
532 { X_axis => 'A001107',
533 Y_axis => 'A033991',
534 Y_neg => 'A033954', # second 10-gonals
535 Diagonal => 'A002939',
536 Diagonal_NW => 'A016742', # 10-gonals average, 4*n^2
537 Diagonal_SW => 'A002943',
538 # OEIS-Other: A001107 planepath=SquareSpiral,n_start=0
539 # OEIS-Catalogue: A033991 planepath=SquareSpiral,n_start=0 line_type=Y_axis
540 # OEIS-Other: A033954 planepath=SquareSpiral,n_start=0 line_type=Y_neg
541 # OEIS-Catalogue: A002939 planepath=SquareSpiral,n_start=0 line_type=Diagonal
542 # OEIS-Other: A016742 planepath=SquareSpiral,n_start=0 line_type=Diagonal_NW
543 # OEIS-Catalogue: A002943 planepath=SquareSpiral,n_start=0 line_type=Diagonal_SW
544 },
545  
546 'wider=1,n_start=1' =>
547 { Diagonal_SW => 'A069894',
548 # OEIS-Catalogue: A069894 planepath=SquareSpiral,wider=1 line_type=Diagonal_SW
549 },
550 'wider=1,n_start=0' =>
551 { Diagonal_SW => 'A016754', # odd squares
552 # OEIS-Other: A016754 planepath=SquareSpiral,wider=1,n_start=0 line_type=Diagonal_SW
553 },
554 };
555 }
556 { package Math::PlanePath::GreekKeySpiral;
557 use constant _NumSeq_X_axis_increasing => 1;
558 use constant _NumSeq_Y_axis_increasing => 1;
559 sub _NumSeq_X_neg_increasing {
560 my ($self) = @_;
561 return ($self->{'turns'} == 0); # when SquareSpiral style
562 }
563 *_NumSeq_Y_neg_increasing = \&_NumSeq_X_neg_increasing;
564 sub _NumSeq_Diagonal_increasing {
565 my ($self) = @_;
566 return ($self->{'turns'} <= 1);
567 }
568 sub _NumSeq_Diagonal_NW_increasing {
569 my ($self) = @_;
570 return ($self->{'turns'} == 0);
571 }
572 *_NumSeq_Diagonal_SW_increasing = \&_NumSeq_Diagonal_increasing;
573 sub _NumSeq_Diagonal_SE_increasing {
574 my ($self) = @_;
575 return ($self->{'turns'} <= 2);
576 }
577  
578 use constant _NumSeq_N_oeis_anum =>
579 { 'turns=0' =>
580 (Math::PlanePath::SquareSpiral
581 ->_NumSeq_N_oeis_anum->{'wider=0,n_start=1'}
582 || die "Oops, SquareSpiral NumSeq PlanePathN not found"),
583 };
584 }
585 { package Math::PlanePath::PyramidSpiral;
586 use constant _NumSeq_X_axis_increasing => 1;
587 use constant _NumSeq_Y_axis_increasing => 1;
588 use constant _NumSeq_X_neg_increasing => 1;
589 use constant _NumSeq_Y_neg_increasing => 1;
590 use constant _NumSeq_Diagonal_increasing => 1;
591 use constant _NumSeq_Diagonal_NW_increasing => 1;
592 use constant _NumSeq_Diagonal_SW_increasing => 1;
593 use constant _NumSeq_Diagonal_SE_increasing => 1;
594  
595 use constant _NumSeq_N_oeis_anum =>
596 { 'n_start=1' =>
597 { X_axis => 'A054552', # square spiral spoke E, 4n^2 - 3n + 1
598 Diagonal_SE => 'A033951', # square spiral spoke S, 4n^2 + 3n + 1
599 # OEIS-Other: A054552 planepath=PyramidSpiral
600 # OEIS-Other: A033951 planepath=PyramidSpiral line_type=Diagonal_SE
601 },
602 'n_start=0' =>
603 { X_axis => 'A001107', # decagonal
604 Y_axis => 'A002939',
605 X_neg => 'A033991',
606 Y_neg => 'A002943',
607 Diagonal_SW => 'A007742',
608 Diagonal_SE => 'A033954', # decagonal second kind
609 # OEIS-Other: A001107 planepath=PyramidSpiral,n_start=0
610 # OEIS-Other: A002939 planepath=PyramidSpiral,n_start=0 line_type=Y_axis
611 # OEIS-Other: A033991 planepath=PyramidSpiral,n_start=0 line_type=X_neg
612 # OEIS-Other: A002943 planepath=PyramidSpiral,n_start=0 line_type=Y_neg
613 # OEIS-Other: A007742 planepath=PyramidSpiral,n_start=0 line_type=Diagonal_SW
614 # OEIS-Other: A033954 planepath=PyramidSpiral,n_start=0 line_type=Diagonal_SE
615 },
616 'n_start=2' =>
617 { Diagonal_SE => 'A185669',
618 # OEIS-Catalogue: A185669 planepath=PyramidSpiral,n_start=2 line_type=Diagonal_SE
619 },
620 };
621 }
622 { package Math::PlanePath::TriangleSpiral;
623 use constant _NumSeq_X_axis_increasing => 1;
624 use constant _NumSeq_Y_axis_increasing => 1;
625 use constant _NumSeq_X_neg_increasing => 1;
626 use constant _NumSeq_Y_neg_increasing => 1;
627 use constant _NumSeq_Diagonal_increasing => 1;
628 use constant _NumSeq_Diagonal_NW_increasing => 1;
629 use constant _NumSeq_Diagonal_SW_increasing => 1;
630 use constant _NumSeq_Diagonal_SE_increasing => 1;
631  
632 use constant _NumSeq_N_oeis_anum =>
633 { 'n_start=1' =>
634 { X_axis => 'A117625', # step by 2 each time
635 Y_neg => 'A006137', # step by 2 each time
636 Diagonal_SW => 'A064225',
637 Diagonal_SE => 'A081267',
638 # OEIS-Other: A117625 planepath=TriangleSpiral
639 # OEIS-Other: A064225 planepath=TriangleSpiral line_type=Diagonal_SW
640 # OEIS-Other: A081267 planepath=TriangleSpiral line_type=Diagonal_SE
641  
642 # # Not quite, starts value=3 at n=0 which is path Y=1
643 # Diagonal => 'A064226', # and duplicate in A081269
644 },
645 'n_start=0' =>
646 { Y_axis => 'A062741', # 3*pentagonal, Y even
647 Diagonal => 'A062708', # reading in direction 0,2,...
648 Diagonal_SW => 'A062725', # reading in direction 0,7,...
649 Diagonal_SE => 'A062728', # 11-gonal "second" per Math::NumSeq::Polygonal
650 # OEIS-Catalogue: A062741 planepath=TriangleSpiral,n_start=0 line_type=Y_axis
651 # OEIS-Catalogue: A062708 planepath=TriangleSpiral,n_start=0 line_type=Diagonal
652 # OEIS-Catalogue: A062725 planepath=TriangleSpiral,n_start=0 line_type=Diagonal_SW
653 # OEIS-Other: A062728 planepath=TriangleSpiral,n_start=0 line_type=Diagonal_SE
654  
655 # but spaced 2 apart ...
656 # X_axis => 'A051682', # 11-gonals per Math::NumSeq::Polygonal
657 # # OEIS-Other: A051682 planepath=TriangleSpiral,n_start=0 # X_axis
658 },
659 };
660 }
661 { package Math::PlanePath::TriangleSpiralSkewed;
662 use constant _NumSeq_X_axis_increasing => 1;
663 use constant _NumSeq_Y_axis_increasing => 1;
664 use constant _NumSeq_X_neg_increasing => 1;
665 use constant _NumSeq_Y_neg_increasing => 1;
666 use constant _NumSeq_Diagonal_increasing => 1;
667 use constant _NumSeq_Diagonal_NW_increasing => 1;
668 use constant _NumSeq_Diagonal_SW_increasing => 1;
669 use constant _NumSeq_Diagonal_SE_increasing => 1;
670  
671 # ENHANCE-ME: All these variously rotated for skew=right,up,down
672 use constant _NumSeq_N_oeis_anum =>
673 { 'skew=left,n_start=1' =>
674 { X_axis => 'A117625',
675 X_neg => 'A006137',
676 Y_neg => 'A064225',
677 Diagonal => 'A081589',
678 Diagonal_SW => 'A038764',
679 Diagonal_SE => 'A081267',
680 # OEIS-Catalogue: A117625 planepath=TriangleSpiralSkewed
681 # OEIS-Catalogue: A006137 planepath=TriangleSpiralSkewed line_type=X_neg
682 # OEIS-Catalogue: A064225 planepath=TriangleSpiralSkewed line_type=Y_neg
683 # OEIS-Catalogue: A081589 planepath=TriangleSpiralSkewed line_type=Diagonal
684 # OEIS-Catalogue: A038764 planepath=TriangleSpiralSkewed line_type=Diagonal_SW
685 # OEIS-Catalogue: A081267 planepath=TriangleSpiralSkewed line_type=Diagonal_SE
686 # OEIS-Catalogue: A081274 planepath=TriangleSpiralSkewed line_type=Diagonal_SW
687  
688 # # Not quite, starts OFFSET=0 value=3 but that is at path Y=1
689 # Y_axis => 'A064226', # and duplicate in A081269
690 },
691 'skew=left,n_start=0' =>
692 { X_axis => 'A051682', # 11-gonals per Math::NumSeq::Polygonal
693 Y_axis => 'A062708', # reading in direction 0,2,...
694 Y_neg => 'A062725', # reading in direction 0,7,...
695 Diagonal_SE => 'A062728', # 11-gonal "second" per Math::NumSeq::Polygonal
696 Diagonal_SW => 'A081266',
697 # OEIS-Other: A051682 planepath=TriangleSpiralSkewed,n_start=0 # X_axis
698 # OEIS-Other: A062708 planepath=TriangleSpiralSkewed,n_start=0 line_type=Y_axis
699 # OEIS-Other: A062725 planepath=TriangleSpiralSkewed,n_start=0 line_type=Y_neg
700 # OEIS-Other: A062728 planepath=TriangleSpiralSkewed,n_start=0 line_type=Diagonal_SE
701 # OEIS-Catalogue: A081266 planepath=TriangleSpiralSkewed,n_start=0 line_type=Diagonal_SW
702 },
703 };
704 }
705 { package Math::PlanePath::DiamondSpiral;
706 use constant _NumSeq_X_axis_increasing => 1;
707 use constant _NumSeq_Y_axis_increasing => 1;
708 use constant _NumSeq_X_neg_increasing => 1;
709 use constant _NumSeq_Y_neg_increasing => 1;
710 use constant _NumSeq_Diagonal_increasing => 1;
711 use constant _NumSeq_Diagonal_NW_increasing => 1;
712 use constant _NumSeq_Diagonal_SW_increasing => 1;
713 use constant _NumSeq_Diagonal_SE_increasing => 1;
714  
715 use constant _NumSeq_N_oeis_anum =>
716 { 'n_start=1' =>
717 { X_axis => 'A130883', # 2*n^2-n+1
718 X_neg => 'A084849', # 2*n^2+n+1
719 Y_axis => 'A058331', # 2*n^2 + 1
720 Y_neg => 'A001844', # centred squares 2n(n+1)+1
721 # OEIS-Catalogue: A130883 planepath=DiamondSpiral
722 # OEIS-Other: A084849 planepath=DiamondSpiral line_type=X_neg
723 # OEIS-Catalogue: A058331 planepath=DiamondSpiral line_type=Y_axis
724 # OEIS-Other: A001844 planepath=DiamondSpiral line_type=Y_neg
725 },
726 'n_start=0' =>
727 { X_axis => 'A000384', # 2*n^2-n, hexagonal numbers
728 X_neg => 'A014105', # 2*n^2+n, hexagonal numbers second kind
729 Y_axis => 'A001105', # 2*n^2
730 Y_neg => 'A046092', # 2n(n+1) = 4*triangular
731 # OEIS-Other: A000384 planepath=DiamondSpiral,n_start=0
732 # OEIS-Other: A014105 planepath=DiamondSpiral,n_start=0 line_type=X_neg
733 # OEIS-Other: A001105 planepath=DiamondSpiral,n_start=0 line_type=Y_axis
734 # OEIS-Other: A046092 planepath=DiamondSpiral,n_start=0 line_type=Y_neg
735 },
736 };
737 }
738 { package Math::PlanePath::DiamondArms;
739 use constant _NumSeq_X_axis_increasing => 1;
740 use constant _NumSeq_Y_axis_increasing => 1;
741 use constant _NumSeq_X_neg_increasing => 1;
742 use constant _NumSeq_Y_neg_increasing => 1;
743 use constant _NumSeq_Diagonal_increasing => 1;
744 use constant _NumSeq_Diagonal_NW_increasing => 1;
745 use constant _NumSeq_Diagonal_SW_increasing => 1;
746 use constant _NumSeq_Diagonal_SE_increasing => 1;
747 }
748 { package Math::PlanePath::AztecDiamondRings;
749 use constant _NumSeq_X_axis_increasing => 1;
750 use constant _NumSeq_Y_axis_increasing => 1;
751 use constant _NumSeq_X_neg_increasing => 1;
752 use constant _NumSeq_Y_neg_increasing => 1;
753 use constant _NumSeq_Diagonal_increasing => 1;
754 use constant _NumSeq_Diagonal_NW_increasing => 1;
755 use constant _NumSeq_Diagonal_SW_increasing => 1;
756 use constant _NumSeq_Diagonal_SE_increasing => 1;
757  
758 use constant _NumSeq_N_oeis_anum =>
759 { 'n_start=1' =>
760 { X_axis => 'A001844', # centred squares 2n(n+1)+1
761 # OEIS-Other: A001844 planepath=AztecDiamondRings
762  
763 # Not quite, A000384 has extra value=0
764 # Y_axis => 'A000384', # hexagonal numbers
765 },
766 'n_start=0' =>
767 { X_axis => 'A046092', # 4*triangular
768 Diagonal => 'A139277', # x*(8*x+5)
769 # OEIS-Other: A046092 planepath=AztecDiamondRings,n_start=0
770 # OEIS-Other: A139277 planepath=AztecDiamondRings,n_start=0 line_type=Diagonal
771 },
772 };
773 }
774 { package Math::PlanePath::PentSpiral;
775 use constant _NumSeq_X_axis_step => 2; # not A2 grid, but X axis steps by 2
776 use constant _NumSeq_X_neg_step => 2;
777 use constant _NumSeq_X_axis_increasing => 1;
778 use constant _NumSeq_Y_axis_increasing => 1;
779 use constant _NumSeq_X_neg_increasing => 1;
780 use constant _NumSeq_Y_neg_increasing => 1;
781 use constant _NumSeq_Diagonal_increasing => 1;
782 use constant _NumSeq_Diagonal_NW_increasing => 1;
783 use constant _NumSeq_Diagonal_SW_increasing => 1;
784 use constant _NumSeq_Diagonal_SE_increasing => 1;
785  
786 use constant _NumSeq_N_oeis_anum =>
787 { 'n_start=1' =>
788 { X_axis => 'A192136', # (5*n^2-3*n+2)/2
789 X_neg => 'A116668', # (5n^2 + n + 2)/2
790 Diagonal_SE => 'A005891', # centred pentagonal (5n^2+5n+2)/2
791 # OEIS-Other: A192136 planepath=PentSpiral
792 # OEIS-Other: A116668 planepath=PentSpiral line_type=X_neg
793 # OEIS-Other: A005891 planepath=PentSpiral line_type=Diagonal_SE
794  
795 # Not quite, A134238 OFFSET=1 vs start X=0 here
796 # Diagonal_SW => 'A134238',
797 },
798  
799 'n_start=0' =>
800 { X_axis => 'A000566', # heptagonals
801 Y_axis => 'A005476',
802 Diagonal_SE => 'A028895', # 5*triangular
803 # OEIS-Other: A000566 planepath=PentSpiral,n_start=0
804 # OEIS-Other: A005476 planepath=PentSpiral,n_start=0 line_type=Y_axis
805 # OEIS-Other: A028895 planepath=PentSpiral,n_start=0 line_type=Diagonal_SE
806 },
807 };
808 }
809 { package Math::PlanePath::PentSpiralSkewed;
810 use constant _NumSeq_X_axis_increasing => 1;
811 use constant _NumSeq_Y_axis_increasing => 1;
812 use constant _NumSeq_X_neg_increasing => 1;
813 use constant _NumSeq_Y_neg_increasing => 1;
814 use constant _NumSeq_Diagonal_increasing => 1;
815 use constant _NumSeq_Diagonal_NW_increasing => 1;
816 use constant _NumSeq_Diagonal_SW_increasing => 1;
817 use constant _NumSeq_Diagonal_SE_increasing => 1;
818  
819 use constant _NumSeq_N_oeis_anum =>
820 { 'n_start=1' =>
821 { X_axis => 'A192136', # (5*n^2-3*n+2)/2
822 X_neg => 'A116668', # (5n^2 + n + 2)/2
823 Diagonal_NW => 'A158187', # 10*n^2 + 1
824 Diagonal_SE => 'A005891', # centred pentagonal (5n^2+5n+2)/2
825 # OEIS-Catalogue: A192136 planepath=PentSpiralSkewed
826 # OEIS-Catalogue: A116668 planepath=PentSpiralSkewed line_type=X_neg
827 # OEIS-Catalogue: A158187 planepath=PentSpiralSkewed line_type=Diagonal_NW
828 # OEIS-Catalogue: A005891 planepath=PentSpiralSkewed line_type=Diagonal_SE
829  
830 # Not quite, A140066 OFFSET=1 but path start Y=0 here
831 # Y_axis => 'A140066', # (5n^2-11n+8)/2 but from Y=0 so using (n-1)
832  
833 # Not quite, A134238 OFFSET=1 but path start Y=0 here
834 # Y_neg => 'A134238',
835 # # OEIS-Catalogue: A134238 planepath=PentSpiralSkewed line_type=Y_neg
836 },
837  
838 'n_start=0' =>
839 { X_axis => 'A000566', # heptagonals
840 Y_axis => 'A005476',
841 X_neg => 'A005475',
842 Diagonal_NW => 'A033583', # 10*n^2
843 Diagonal_SE => 'A028895', # 5*triangular
844 # OEIS-Other: A000566 planepath=PentSpiralSkewed,n_start=0
845 # OEIS-Catalogue: A005476 planepath=PentSpiralSkewed,n_start=0 line_type=Y_axis
846 # OEIS-Catalogue: A005475 planepath=PentSpiralSkewed,n_start=0 line_type=X_neg
847 # OEIS-Other: A033583 planepath=PentSpiralSkewed,n_start=0 line_type=Diagonal_NW
848 # OEIS-Catalogue: A028895 planepath=PentSpiralSkewed,n_start=0 line_type=Diagonal_SE
849  
850 # Not quite, A147875 OFFSET=1 vs start Y=0 here
851 # Y_neg => 'A147875', # second heptagonals
852 # # OEIS-Other: A147875 planepath=PentSpiralSkewed,n_start=0 line_type=Y_neg
853 },
854 };
855 }
856 { package Math::PlanePath::HexSpiral;
857 use constant _NumSeq_X_axis_increasing => 1;
858 use constant _NumSeq_Y_axis_increasing => 1;
859 *_NumSeq_X_neg_increasing
860 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing;
861 *_NumSeq_X_neg_increasing_from_i
862 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing_from_i;
863 *_NumSeq_X_neg_min
864 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_min;
865 use constant _NumSeq_Y_neg_increasing => 1;
866 use constant _NumSeq_Diagonal_increasing => 1;
867 use constant _NumSeq_Diagonal_NW_increasing => 1;
868 use constant _NumSeq_Diagonal_SW_increasing => 1;
869 use constant _NumSeq_Diagonal_SE_increasing => 1;
870  
871 use constant _NumSeq_N_oeis_anum =>
872 { 'wider=0,n_start=1' =>
873 { X_axis => 'A056105', # first spoke 3n^2-2n+1
874 Diagonal => 'A056106', # second spoke 3n^2-n+1
875 Diagonal_NW => 'A056107', # third spoke 3n^2+1
876 X_neg => 'A056108', # fourth spoke 3n^2+n+1
877 Diagonal_SW => 'A056109', # fifth spoke 3n^2+2n+1
878 Diagonal_SE => 'A003215', # centred hexagonal numbers
879 # OEIS-Other: A056105 planepath=HexSpiral
880 # OEIS-Other: A056106 planepath=HexSpiral line_type=Diagonal
881 # OEIS-Other: A056107 planepath=HexSpiral line_type=Diagonal_NW
882 # OEIS-Other: A056108 planepath=HexSpiral line_type=X_neg
883 # OEIS-Other: A056109 planepath=HexSpiral line_type=Diagonal_SW
884 # OEIS-Other: A003215 planepath=HexSpiral line_type=Diagonal_SE
885 },
886 'wider=0,n_start=0' =>
887 { X_axis => 'A000567', # octagonal numbers
888 X_neg => 'A049451',
889 Diagonal => 'A049450',
890 Diagonal_NW => 'A033428', # octagonal numbers first,second average
891 Diagonal_SW => 'A045944', # octagonal numbers second
892 Diagonal_SE => 'A028896',
893 # OEIS-Other: A000567 planepath=HexSpiral,n_start=0
894 # OEIS-Other: A049451 planepath=HexSpiral,n_start=0 line_type=X_neg
895 # OEIS-Catalogue: A049450 planepath=HexSpiral,n_start=0 line_type=Diagonal
896 # OEIS-Other: A033428 planepath=HexSpiral,n_start=0 line_type=Diagonal_NW
897 # OEIS-Other: A045944 planepath=HexSpiral,n_start=0 line_type=Diagonal_SW
898 # OEIS-Catalogue: A028896 planepath=HexSpiral,n_start=0 line_type=Diagonal_SE
899 },
900 };
901 }
902 { package Math::PlanePath::HexSpiralSkewed;
903 use constant _NumSeq_X_axis_increasing => 1;
904 use constant _NumSeq_Y_axis_increasing => 1;
905 *_NumSeq_X_neg_increasing
906 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing;
907 *_NumSeq_X_neg_increasing_from_i
908 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing_from_i;
909 *_NumSeq_X_neg_min
910 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_min;
911 use constant _NumSeq_Y_neg_increasing => 1;
912 use constant _NumSeq_Diagonal_increasing => 1;
913 use constant _NumSeq_Diagonal_NW_increasing => 1;
914 use constant _NumSeq_Diagonal_SW_increasing => 1;
915 use constant _NumSeq_Diagonal_SE_increasing => 1;
916  
917 use constant _NumSeq_N_oeis_anum =>
918 { 'wider=0,n_start=1' =>
919 { X_axis => 'A056105', # first spoke 3n^2-2n+1
920 Y_axis => 'A056106', # second spoke 3n^2-n+1
921 Diagonal_NW => 'A056107', # third spoke 3n^2+1
922 X_neg => 'A056108', # fourth spoke 3n^2+n+1
923 Y_neg => 'A056109', # fifth spoke 3n^2+2n+1
924 Diagonal_SE => 'A003215', # centred hexagonal numbers
925 # OEIS-Catalogue: A056105 planepath=HexSpiralSkewed
926 # OEIS-Catalogue: A056106 planepath=HexSpiralSkewed line_type=Y_axis
927 # OEIS-Catalogue: A056108 planepath=HexSpiralSkewed line_type=X_neg
928 # OEIS-Catalogue: A056109 planepath=HexSpiralSkewed line_type=Y_neg
929 # OEIS-Catalogue: A056107 planepath=HexSpiralSkewed line_type=Diagonal_NW
930 # OEIS-Other: A003215 planepath=HexSpiralSkewed line_type=Diagonal_SE
931 },
932 'wider=0,n_start=0' =>
933 { X_axis => 'A000567', # octagonal numbers
934 Y_axis => 'A049450',
935 X_neg => 'A049451',
936 Y_neg => 'A045944', # octagonal numbers second
937 Diagonal => 'A062783',
938 Diagonal_NW => 'A033428', # octagonal numbers first,second average
939 Diagonal_SW => 'A063436',
940 Diagonal_SE => 'A028896',
941 # OEIS-Other: A000567 planepath=HexSpiralSkewed,n_start=0
942 # OEIS-Other: A049450 planepath=HexSpiralSkewed,n_start=0 line_type=Y_axis
943 # OEIS-Catalogue: A049451 planepath=HexSpiralSkewed,n_start=0 line_type=X_neg
944 # OEIS-Other: A045944 planepath=HexSpiralSkewed,n_start=0 line_type=Y_neg
945 # OEIS-Catalogue: A062783 planepath=HexSpiralSkewed,n_start=0 line_type=Diagonal
946 # OEIS-Other: A033428 planepath=HexSpiralSkewed,n_start=0 line_type=Diagonal_NW
947 # OEIS-Catalogue: A063436 planepath=HexSpiralSkewed,n_start=0 line_type=Diagonal_SW
948 # OEIS-Other: A028896 planepath=HexSpiralSkewed,n_start=0 line_type=Diagonal_SE
949 },
950  
951 # wider=1 X_axis almost 3*n^2 but not initial X=0 value
952 # wider=1 Y_axis almost A049451 twice pentagonal but not initial X=0
953 # wider=2 Y_axis almost A028896 6*triangular but not initial Y=0
954 };
955 }
956 { package Math::PlanePath::HexArms;
957 use constant _NumSeq_X_axis_increasing => 1;
958 use constant _NumSeq_Y_axis_increasing => 1;
959 use constant _NumSeq_X_neg_increasing => 1;
960 use constant _NumSeq_Y_neg_increasing => 1;
961 use constant _NumSeq_Diagonal_increasing => 1;
962 use constant _NumSeq_Diagonal_NW_increasing => 1;
963 use constant _NumSeq_Diagonal_SW_increasing => 1;
964 use constant _NumSeq_Diagonal_SE_increasing => 1;
965 }
966 { package Math::PlanePath::HeptSpiralSkewed;
967 use constant _NumSeq_X_axis_increasing => 1;
968 use constant _NumSeq_Y_axis_increasing => 1;
969 use constant _NumSeq_X_neg_increasing => 1;
970 use constant _NumSeq_Y_neg_increasing => 1;
971 use constant _NumSeq_Diagonal_increasing => 1;
972 use constant _NumSeq_Diagonal_NW_increasing => 1;
973 use constant _NumSeq_Diagonal_SW_increasing => 1;
974 use constant _NumSeq_Diagonal_SE_increasing => 1;
975  
976 use constant _NumSeq_N_oeis_anum =>
977 {
978 # 'n_start=1' =>
979 # {
980 # # Not quite, OFFSET=1 vs path start X=Y=0
981 # # Y_axis => 'A140065', # (7n^2 - 17n + 12)/2 but starting Y=0 not n=1
982 # # Diagonal_NW => 'A140063',
983 # # Diagonal_SE => 'A069099',
984 # },
985  
986 'n_start=0' =>
987 { X_axis => 'A001106', # 9-gonals
988 Y_axis => 'A218471',
989 X_neg => 'A022265',
990 Y_neg => 'A179986', # second 9-gonals
991 Diagonal => 'A195023',
992 Diagonal_NW => 'A022264',
993 Diagonal_SW => 'A186029',
994 Diagonal_SE => 'A024966',
995 # OEIS-Other: A001106 planepath=HeptSpiralSkewed,n_start=0
996 # OEIS-Catalogue: A022265 planepath=HeptSpiralSkewed,n_start=0 line_type=X_neg
997 # OEIS-Catalogue: A218471 planepath=HeptSpiralSkewed,n_start=0 line_type=Y_axis
998 # OEIS-Other: A179986 planepath=HeptSpiralSkewed,n_start=0 line_type=Y_neg
999 # OEIS-Catalogue: A195023 planepath=HeptSpiralSkewed,n_start=0 line_type=Diagonal
1000 # OEIS-Catalogue: A022264 planepath=HeptSpiralSkewed,n_start=0 line_type=Diagonal_NW
1001 # OEIS-Catalogue: A186029 planepath=HeptSpiralSkewed,n_start=0 line_type=Diagonal_SW
1002 # OEIS-Catalogue: A024966 planepath=HeptSpiralSkewed,n_start=0 line_type=Diagonal_SE
1003 },
1004 };
1005 }
1006 { package Math::PlanePath::OctagramSpiral;
1007 use constant _NumSeq_X_axis_increasing => 1;
1008 use constant _NumSeq_Y_axis_increasing => 1;
1009 use constant _NumSeq_X_neg_increasing => 1;
1010 use constant _NumSeq_Y_neg_increasing => 1;
1011 use constant _NumSeq_Diagonal_increasing => 1;
1012 use constant _NumSeq_Diagonal_NW_increasing => 1;
1013 use constant _NumSeq_Diagonal_SW_increasing => 1;
1014 use constant _NumSeq_Diagonal_SE_increasing => 1;
1015  
1016 use constant _NumSeq_N_oeis_anum =>
1017 {
1018 'n_start=1' =>
1019 { Diagonal_SE => 'A194268',
1020 # OEIS-Other: A194268 planepath=OctagramSpiral line_type=Diagonal_SE
1021  
1022 # Not quite, but A125201 doesn't have initial N=1 for path origin
1023 # X_axis => 'A125201'
1024 },
1025  
1026 'n_start=0' =>
1027 { X_axis => 'A051870', # 18-gonals
1028 Y_axis => 'A139273',
1029 X_neg => 'A139275',
1030 Y_neg => 'A139277',
1031 Diagonal => 'A139272',
1032 Diagonal_NW => 'A139274',
1033 Diagonal_SW => 'A139276',
1034 Diagonal_SE => 'A139278', # second 18-gonals
1035 # OEIS-Other: A051870 planepath=OctagramSpiral,n_start=0
1036 # OEIS-Catalogue: A139273 planepath=OctagramSpiral,n_start=0 line_type=Y_axis
1037 # OEIS-Catalogue: A139275 planepath=OctagramSpiral,n_start=0 line_type=X_neg
1038 # OEIS-Catalogue: A139277 planepath=OctagramSpiral,n_start=0 line_type=Y_neg
1039 # OEIS-Catalogue: A139272 planepath=OctagramSpiral,n_start=0 line_type=Diagonal
1040 # OEIS-Catalogue: A139274 planepath=OctagramSpiral,n_start=0 line_type=Diagonal_NW
1041 # OEIS-Catalogue: A139276 planepath=OctagramSpiral,n_start=0 line_type=Diagonal_SW
1042 # OEIS-Other: A139278 planepath=OctagramSpiral,n_start=0 line_type=Diagonal_SE
1043 },
1044 };
1045 }
1046 { package Math::PlanePath::AnvilSpiral;
1047 use constant _NumSeq_X_axis_increasing => 1;
1048 use constant _NumSeq_Y_axis_increasing => 1;
1049 *_NumSeq_X_neg_increasing
1050 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing;
1051 *_NumSeq_X_neg_increasing_from_i
1052 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_increasing_from_i;
1053 *_NumSeq_X_neg_min
1054 = \&Math::PlanePath::SquareSpiral::_NumSeq_X_neg_min;
1055 use constant _NumSeq_Y_neg_increasing => 1;
1056 use constant _NumSeq_Diagonal_increasing => 1;
1057 use constant _NumSeq_Diagonal_NW_increasing => 1;
1058 use constant _NumSeq_Diagonal_SW_increasing => 1;
1059 use constant _NumSeq_Diagonal_SE_increasing => 1;
1060  
1061 use constant _NumSeq_N_oeis_anum =>
1062 { 'wider=0,n_start=1' =>
1063 { X_axis => 'A033570', # odd pentagonals (2n+1)*(3n+1)
1064 Diagonal => 'A033568', # odd second pentagonals
1065 Diagonal_SE => 'A085473',
1066 # OEIS-Catalogue: A033570 planepath=AnvilSpiral
1067 # OEIS-Catalogue: A033568 planepath=AnvilSpiral line_type=Diagonal
1068 # OEIS-Catalogue: A085473 planepath=AnvilSpiral line_type=Diagonal_SE
1069  
1070 # Not quite, A136392 OFFSET=1 value=1 whereas path start Y=0 value=1
1071 # Y_neg => 'A136392', # 1,9,29,61, 6n^2-10n+5
1072 },
1073 'wider=0,n_start=1,i_start=1' =>
1074 { Y_axis => 'A126587', # points within 3,4,5 triangle, starting value=3
1075 # OEIS-Catalogue: A126587 planepath=AnvilSpiral line_type=Y_axis i_start=1
1076 },
1077  
1078 'wider=0,n_start=0' =>
1079 { X_axis => 'A211014', # 14-gonal second
1080 Y_axis => 'A139267', # 2*octagonal
1081 X_neg => 'A049452', # alternate pentagonals
1082 Y_neg => 'A033580', # 4*second pentagonals
1083 Diagonal => 'A051866', # 14-gonals
1084 Diagonal_NW => 'A094159', # 3*hexagonal
1085 Diagonal_SW => 'A049453',
1086 Diagonal_SE => 'A195319', # 3*second hexagonal
1087 # OEIS-Other: A211014 planepath=AnvilSpiral,n_start=0
1088 # OEIS-Other: A051866 planepath=AnvilSpiral,n_start=0 line_type=Diagonal
1089 # OEIS-Catalogue: A139267 planepath=AnvilSpiral,n_start=0 line_type=Y_axis
1090 # OEIS-Catalogue: A049452 planepath=AnvilSpiral,n_start=0 line_type=X_neg
1091 # OEIS-Catalogue: A033580 planepath=AnvilSpiral,n_start=0 line_type=Y_neg
1092 # OEIS-Catalogue: A094159 planepath=AnvilSpiral,n_start=0 line_type=Diagonal_NW
1093 # OEIS-Catalogue: A049453 planepath=AnvilSpiral,n_start=0 line_type=Diagonal_SW
1094 # OEIS-Catalogue: A195319 planepath=AnvilSpiral,n_start=0 line_type=Diagonal_SE
1095 },
1096  
1097 # Not quite, A051866 starts value=0 which is at X=-1
1098 # 'wider=1,n_start=0' =>
1099 # { X_axis => 'A051866',
1100 # # OEIS-Other: A051866 planepath=AnvilSpiral,wider=1,n_start=0
1101 # },
1102 # 'wider=1,n_start=0' =>
1103 # { Diagonal_NW_minus_1 => 'A033569', # (2*n-1)*(3*n+1) starting -1
1104 # # XX-Other: A033569 planepath=AnvilSpiral,wider=1,n_start=-1 line_type=Diagonal_NW
1105 # },
1106  
1107 # 'wider=2,n_start=1' =>
1108 # {
1109 # Not quite, A033581 initial value=2 whereas path start N=0
1110 # # Y_axis => 'A033581', # 6*n^2 is 14-gonals pairs average in Math::NumSeq::Polygonal
1111 # # # OEIS-Other: A033581 planepath=AnvilSpiral,wider=2 line_type=Y_axis
1112 # },
1113 };
1114 }
1115 { package Math::PlanePath::KnightSpiral;
1116 use constant _NumSeq_Diagonal_increasing => 1; # low then high
1117 use constant _NumSeq_Diagonal_NW_increasing => 1;
1118 use constant _NumSeq_Diagonal_SW_increasing => 1;
1119 use constant _NumSeq_Diagonal_SE_increasing => 1;
1120 }
1121 { package Math::PlanePath::CretanLabyrinth;
1122 use constant _NumSeq_X_axis_increasing => 1;
1123 }
1124 { package Math::PlanePath::SquareArms;
1125 use constant _NumSeq_X_axis_increasing => 1;
1126 use constant _NumSeq_Y_axis_increasing => 1;
1127 use constant _NumSeq_X_neg_increasing => 1;
1128 use constant _NumSeq_Y_neg_increasing => 1;
1129 use constant _NumSeq_Diagonal_increasing => 1;
1130 use constant _NumSeq_Diagonal_NW_increasing => 1;
1131 use constant _NumSeq_Diagonal_SW_increasing => 1;
1132 use constant _NumSeq_Diagonal_SE_increasing => 1;
1133 }
1134 { package Math::PlanePath::SacksSpiral;
1135 use constant _NumSeq_X_axis_increasing => 1;
1136 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1137 use constant _NumSeq_X_neg_increasing => 1;
1138 use constant _NumSeq_Y_neg_increasing => 1;
1139 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1140 use constant _NumSeq_Diagonal_NW_increasing => 1;
1141 use constant _NumSeq_Diagonal_SW_increasing => 1;
1142 use constant _NumSeq_Diagonal_SE_increasing => 1;
1143  
1144 # SacksSpiral X_axis -- squares (i-1)^2, starting from i=1 value=0
1145 }
1146 { package Math::PlanePath::VogelFloret;
1147 use constant _NumSeq_X_axis_increasing => 1; # when touched
1148 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1149 use constant _NumSeq_X_neg_increasing => 1;
1150 use constant _NumSeq_Y_neg_increasing => 1;
1151 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1152 use constant _NumSeq_Diagonal_NW_increasing => 1;
1153 use constant _NumSeq_Diagonal_SW_increasing => 1;
1154 use constant _NumSeq_Diagonal_SE_increasing => 1;
1155 }
1156 { package Math::PlanePath::TheodorusSpiral;
1157 use constant _NumSeq_X_axis_increasing => 1; # when touched
1158 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1159 use constant _NumSeq_X_neg_increasing => 1;
1160 use constant _NumSeq_Y_neg_increasing => 1;
1161 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1162 use constant _NumSeq_Diagonal_NW_increasing => 1;
1163 use constant _NumSeq_Diagonal_SW_increasing => 1;
1164 use constant _NumSeq_Diagonal_SE_increasing => 1;
1165 }
1166 { package Math::PlanePath::ArchimedeanChords;
1167 use constant _NumSeq_X_axis_increasing => 1; # when touched
1168 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1169 use constant _NumSeq_X_neg_increasing => 1;
1170 use constant _NumSeq_Y_neg_increasing => 1;
1171 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1172 use constant _NumSeq_Diagonal_NW_increasing => 1;
1173 use constant _NumSeq_Diagonal_SW_increasing => 1;
1174 use constant _NumSeq_Diagonal_SE_increasing => 1;
1175 }
1176 { package Math::PlanePath::MultipleRings;
1177 use constant _NumSeq_X_axis_increasing => 1;
1178 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1179 use constant _NumSeq_X_neg_increasing => 1;
1180 use constant _NumSeq_Y_neg_increasing => 1;
1181 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1182 use constant _NumSeq_Diagonal_NW_increasing => 1;
1183 use constant _NumSeq_Diagonal_SW_increasing => 1;
1184 use constant _NumSeq_Diagonal_SE_increasing => 1;
1185 }
1186 { package Math::PlanePath::PixelRings;
1187 use constant _NumSeq_X_axis_increasing => 1;
1188 use constant _NumSeq_Y_axis_increasing => 1;
1189 use constant _NumSeq_X_neg_increasing => 1;
1190 use constant _NumSeq_Y_neg_increasing => 1;
1191 use constant _NumSeq_Diagonal_increasing => 1; # where covered
1192 use constant _NumSeq_Diagonal_NW_increasing => 1;
1193 use constant _NumSeq_Diagonal_SW_increasing => 1;
1194 use constant _NumSeq_Diagonal_SE_increasing => 1;
1195 }
1196 { package Math::PlanePath::FilledRings;
1197 use constant _NumSeq_X_axis_increasing => 1;
1198 use constant _NumSeq_Y_axis_increasing => 1;
1199 use constant _NumSeq_X_neg_increasing => 1;
1200 use constant _NumSeq_Y_neg_increasing => 1;
1201 use constant _NumSeq_Diagonal_increasing => 1;
1202 use constant _NumSeq_Diagonal_NW_increasing => 1;
1203 use constant _NumSeq_Diagonal_SW_increasing => 1;
1204 use constant _NumSeq_Diagonal_SE_increasing => 1;
1205  
1206 # use constant _NumSeq_N_oeis_anum =>
1207 # {
1208 # # Not quite, A036704 OFFSET=0 value=1,9,21 vs X=0 value=0,1,9,21
1209 # 'n_start=0' =>
1210 # { X_axis => 'A036704', # count points norm <= n+1/2
1211 # },
1212 # };
1213 }
1214 { package Math::PlanePath::Hypot;
1215 sub _NumSeq_X_axis_i_start {
1216 my ($self) = @_;
1217 ### _NumSeq_X_axis_i_start() ...
1218 return ($self->{'points'} eq 'odd'
1219 ? 1 # X=0,Y=0 not visited
1220 : 0);
1221 }
1222 sub _NumSeq_X_neg_i_start {
1223 my ($self) = @_;
1224 ### _NumSeq_X_axis_i_start() ...
1225 return ($self->{'points'} eq 'odd'
1226 ? -1 # X=0,Y=0 not visited
1227 : 0);
1228 }
1229 *_NumSeq_Y_axis_i_start = \&_NumSeq_X_axis_i_start;
1230 *_NumSeq_Y_neg_i_start = \&_NumSeq_X_neg_i_start;
1231  
1232 use constant _NumSeq_X_axis_increasing => 1;
1233 use constant _NumSeq_Y_axis_increasing => 1;
1234 use constant _NumSeq_X_neg_increasing => 1;
1235 use constant _NumSeq_Y_neg_increasing => 1;
1236 use constant _NumSeq_Diagonal_increasing => 1;
1237 use constant _NumSeq_Diagonal_NW_increasing => 1;
1238 use constant _NumSeq_Diagonal_SW_increasing => 1;
1239 use constant _NumSeq_Diagonal_SE_increasing => 1;
1240  
1241 use constant _NumSeq_N_oeis_anum =>
1242 { 'points=all,n_start=0' =>
1243 { X_axis => 'A051132', # count points < n^2
1244 # OEIS-Catalogue: A051132 planepath=Hypot,n_start=0
1245 },
1246 };
1247 }
1248 { package Math::PlanePath::HypotOctant;
1249 use constant _NumSeq_X_axis_increasing => 1;
1250 use constant _NumSeq_Y_axis_increasing => 1;
1251 use constant _NumSeq_Diagonal_increasing => 1;
1252 *_NumSeq_X_axis_i_start = \&Math::PlanePath::Hypot::_NumSeq_X_axis_i_start;
1253  
1254 use constant _NumSeq_N_oeis_anum =>
1255 { 'points=even' =>
1256 { Diagonal => 'A036702', # count points |z|<=n for 0<=b<=a
1257 # OEIS-Catalogue: A036702 planepath=HypotOctant,points=even line_type=Diagonal
1258 },
1259 };
1260 }
1261 { package Math::PlanePath::TriangularHypot;
1262 sub _NumSeq_X_axis_i_start {
1263 my ($self) = @_;
1264 return ($self->{'points'} eq 'odd' || $self->{'points'} eq 'hex_centred'
1265 ? 1 # X=0,Y=0 not visited
1266 : 0);
1267 }
1268 *_NumSeq_Diagonal_i_start = \&_NumSeq_X_axis_i_start;
1269 *_NumSeq_Diagonal_SE_i_start = \&_NumSeq_X_axis_i_start;
1270 sub _NumSeq_X_neg_i_start {
1271 my ($self) = @_;
1272 return - $self->_NumSeq_X_axis_i_start;
1273 }
1274 *_NumSeq_Diagonal_NW_i_start = \&_NumSeq_X_axis_i_start;
1275 *_NumSeq_Diagonal_SW_i_start = \&_NumSeq_X_axis_i_start;
1276 use constant _NumSeq_X_axis_increasing => 1;
1277 use constant _NumSeq_Y_axis_increasing => 1;
1278 use constant _NumSeq_X_neg_increasing => 1;
1279 use constant _NumSeq_Y_neg_increasing => 1;
1280 use constant _NumSeq_Diagonal_increasing => 1;
1281 use constant _NumSeq_Diagonal_NW_increasing => 1;
1282 use constant _NumSeq_Diagonal_SW_increasing => 1;
1283 use constant _NumSeq_Diagonal_SE_increasing => 1;
1284 }
1285 { package Math::PlanePath::PythagoreanTree;
1286 use constant _NumSeq_X_axis_increasing => 1;
1287  
1288 use constant _NumSeq_N_oeis_all_anum =>
1289 { Depth_start => 'A007051', # (3^n+1)/2
1290 # OEIS-Catalogue: A007051 planepath=PythagoreanTree line_type=Depth_start
1291  
1292 # Not quite, Depth_end=(3^(n+1)-1)/2, so is n+1
1293 # Depth_end => 'A003462', # (3^n-1)/2
1294 };
1295 }
1296 { package Math::PlanePath::RationalsTree;
1297 use constant _NumSeq_X_axis_increasing => 1;
1298  
1299 sub _NumSeq_Y_axis_increasing {
1300 my ($self) = @_;
1301 return ($self->{'tree_type'} eq 'L' ? 0 : 1);
1302 }
1303 sub _NumSeq_Y_axis_increasing_from_i {
1304 my ($self) = @_;
1305 return ($self->{'tree_type'} eq 'L' ? 2 : 1);
1306 }
1307 use constant _NumSeq_Y_axis_min => 1;
1308 use constant _NumSeq_Diagonal_increasing => 1;
1309  
1310 use constant _NumSeq_N_oeis_anum =>
1311 { 'tree_type=SB' =>
1312 { Depth_start => 'A000079', # powers-of-2
1313 # RationalsTree SB -- X_axis 2^n-1 but starting X=1
1314 # RationalsTree SB,CW -- Y_axis A000079 2^n but starting Y=1
1315 },
1316  
1317 'tree_type=CW' =>
1318 { Depth_start => 'A000079', # powers-of-2
1319 },
1320  
1321 'tree_type=Bird' =>
1322 { X_axis => 'A081254', # local max sumdisttopow2(m)/m^2
1323 Depth_start => 'A000079', # powers-of-2
1324 # OEIS-Catalogue: A081254 planepath=RationalsTree,tree_type=Bird
1325 # OEIS-Other: A000079 planepath=RationalsTree,tree_type=Bird line_type=Depth_start
1326  
1327 # RationalsTree Bird -- Y_axis almost A000975 10101 101010 no
1328 # consecutive equal bits, but start=1
1329 },
1330  
1331 'tree_type=Drib' =>
1332 { X_axis => 'A086893', # pos of fibonacci F(n+1)/F(n) in Stern diatomic
1333 Depth_start => 'A000079', # powers-of-2
1334 # OEIS-Catalogue: A086893 planepath=RationalsTree,tree_type=Drib
1335  
1336 # Drib Y_axis
1337 # Not quite, A061547 OFFSET=1 value=0 cf path Y=1 value N=1
1338 # Y_axis => 'A061547'# derangements or alternating bits plus pow4
1339 },
1340  
1341 'tree_type=AYT' =>
1342 { Depth_start => 'A000079', # powers-of-2
1343 # RationalsTree AYT -- Y_axis A083318 2^n+1 but starting Y=1
1344 },
1345  
1346 'tree_type=HCS' =>
1347 { Depth_start => 'A000079', # powers-of-2
1348  
1349 # RationalsTree HCS
1350 # Not quite, A000079 OFFSET=0 value=1 cf here X=1 N=1
1351 # X_axis => 'A000079', # powers 2^X
1352 # Not quite, A007283 OFFSET=0 and doesn't have extra N=1 at Y=1
1353 # Y_axis => 'A007283', # 3*2^n starting OFFSET=0 value=3
1354 },
1355 };
1356 }
1357 { package Math::PlanePath::FractionsTree;
1358 use constant _NumSeq_Diagonal_increasing => 1;
1359 use constant _NumSeq_Diagonal_X_offset => -1;
1360  
1361 use constant _NumSeq_Y_axis_increasing => 1;
1362 use constant _NumSeq_Y_axis_i_start => 2;
1363 }
1364 { package Math::PlanePath::ChanTree;
1365 use constant _NumSeq_X_axis_increasing => 1;
1366 use constant _NumSeq_X_axis_i_start => 1;
1367  
1368 use constant _NumSeq_Y_axis_i_start => 1; # start at Y=1
1369 use constant _NumSeq_Y_axis_increasing => 1;
1370  
1371 use constant _NumSeq_Diagonal_increasing => 1;
1372  
1373 use constant _NumSeq_N_oeis_anum =>
1374 { 'k=2,n_start=1' =>
1375 { Depth_start => 'A000079', # powers-of-2
1376 # OEIS-Other: A000079 planepath=ChanTree,n_start=1,k=2 line_type=Depth_start
1377  
1378 # Depth_end is 2^k-1 A000225, or 2^k-2 A000918, but without initial
1379 # 0 or -1.
1380 },
1381 'k=2,n_start=0' =>
1382 { Depth_start => 'A000225', # 2^k-1
1383 # OEIS-Other: A000225 planepath=ChanTree,k=2 line_type=Depth_start
1384 },
1385  
1386 'k=3,n_start=1' =>
1387 { Depth_start => 'A000244', # powers-of-3
1388 # OEIS-Other: A000244 planepath=ChanTree,n_start=1 line_type=Depth_start
1389 },
1390 'k=4,n_start=1' =>
1391 { Depth_start => 'A000302', # powers-of-4
1392 # OEIS-Other: A000302 planepath=ChanTree,n_start=1,k=4 line_type=Depth_start
1393 },
1394 'k=5,n_start=1' =>
1395 { Depth_start => 'A000351', # powers-of-5
1396 # OEIS-Other: A000351 planepath=ChanTree,n_start=1,k=5 line_type=Depth_start
1397 },
1398 'k=10,n_start=1' =>
1399 { Depth_start => 'A011557', # powers-of-10
1400 # OEIS-Other: A011557 planepath=ChanTree,n_start=1,k=10 line_type=Depth_start
1401 },
1402 };
1403 }
1404 { package Math::PlanePath::DiagonalRationals;
1405 use constant _NumSeq_X_axis_increasing => 1;
1406 use constant _NumSeq_Y_axis_increasing => 1;
1407 use constant _NumSeq_X_axis_i_start => 1;
1408 use constant _NumSeq_Y_axis_i_start => 1;
1409  
1410 # Diagonal => 'A002088', # cumulative totient
1411 # Not quite, start X=1 value=1 cf seq OFFSET=0 value=0
1412 }
1413 { package Math::PlanePath::FactorRationals;
1414 use constant _NumSeq_X_axis_i_start => 1;
1415 sub _NumSeq_X_axis_increasing {
1416 my ($self) = @_;
1417 # perfect squares along X axis of even/odd
1418 return $self->{'factor_coding'} eq 'even/odd';
1419 }
1420  
1421 use constant _NumSeq_Y_axis_i_start => 1;
1422 sub _NumSeq_Y_axis_increasing {
1423 my ($self) = @_;
1424 # perfect squares along Y axis of odd/even
1425 return $self->{'factor_coding'} eq 'odd/even';
1426 }
1427  
1428 use constant _NumSeq_N_oeis_anum =>
1429 { 'factor_coding=even/odd' =>
1430 { Y_axis => 'A102631', # n^2/(squarefree kernel)
1431 # OEIS-Catalogue: A102631 planepath=FactorRationals line_type=Y_axis
1432  
1433 # # Not quite, OFFSET=0 value 0 whereas start X=Y=1 value 1 here
1434 # X_axis => 'A000290', # squares 0,1,4,9
1435 # # OEIS-Other: A000290 planepath=FactorRationals
1436 },
1437 'factor_coding=odd/even' =>
1438 { X_axis => 'A102631', # n^2/(squarefree kernel)
1439 # OEIS-Other: A102631 planepath=FactorRationals,factor_coding=odd/even
1440 },
1441 };
1442 }
1443 { package Math::PlanePath::GcdRationals;
1444 use constant _NumSeq_X_axis_increasing => 1;
1445 use constant _NumSeq_Y_axis_increasing => 1;
1446 use constant _NumSeq_X_axis_i_start => 1;
1447 use constant _NumSeq_Y_axis_i_start => 1;
1448  
1449 # GcdRationals
1450 # Not quite, starts X=1
1451 # X_axis => triangular row
1452 # Not quite, starts X=1 here cf OFFSET=0 in A000124
1453 # Y_axis => 'A000124', # triangular+1
1454 #
1455 # GcdRationals,pairs_order=diagonals_down
1456 # Not quite, start X=1 here cf A000290 starts OFFSET=1
1457 # X_axis => 'A000290', # Y=1 row, perfect squares
1458 # Not quite, A033638 starts two ones 1,1,...
1459 # Y_axis => 'A033638', # quarter-squares + 1
1460 #
1461 # GcdRationals,pairs_order=diagonals_up
1462 # Not quite, A002061 starts two ones 1,1,
1463 # X_axis => 'A002061',
1464 # Not quite, X=1 column squares+pronic, but no initial 0,0 of A002620
1465 # Y_axis => 'A002620', # X=1 column
1466 # Not quite, starting value=2 here
1467 # Diagonal_above => 'A002522', # Y=X+1 diagonal, squares+1
1468 }
1469 { package Math::PlanePath::CfracDigits;
1470 # 1
1471 # diagonal Y/(Y+1) = 0 + -----
1472 # 1 + 1/Y
1473 # q0=1 q1=Y
1474 # N = 3,Y-1 in 1,2,3
1475 # = 1,0,Y-1 in 0,1,2
1476 #
1477 use constant _NumSeq_Diagonal_increasing => 1;
1478 use constant _NumSeq_Diagonal_X_offset => -1;
1479 use constant _NumSeq_Y_axis_increasing => 1; # radix without digit 0
1480 }
1481 { package Math::PlanePath::PeanoCurve;
1482 sub _NumSeq_X_axis_increasing {
1483 my ($self) = @_;
1484 return ($self->{'radix'} % 2);
1485 }
1486 *_NumSeq_Y_axis_increasing = \&_NumSeq_X_axis_increasing;
1487  
1488 use constant _NumSeq_N_oeis_anum =>
1489 { 'radix=3' =>
1490 { X_axis => 'A163480', # axis same as initial direction
1491 Y_axis => 'A163481', # axis opp to initial direction
1492 Diagonal => 'A163343',
1493 },
1494 # OEIS-Catalogue: A163480 planepath=PeanoCurve
1495 # OEIS-Catalogue: A163481 planepath=PeanoCurve line_type=Y_axis
1496 # OEIS-Catalogue: A163343 planepath=PeanoCurve line_type=Diagonal
1497  
1498 # OEIS-Other: A163480 planepath=GrayCode,apply_type=TsF,radix=3
1499 # OEIS-Other: A163481 planepath=GrayCode,apply_type=TsF,radix=3 line_type=Y_axis
1500 # OEIS-Other: A163343 planepath=GrayCode,apply_type=TsF,radix=3 line_type=Diagonal
1501  
1502 # OEIS-Other: A163480 planepath=GrayCode,apply_type=FsT,radix=3
1503 # OEIS-Other: A163481 planepath=GrayCode,apply_type=FsT,radix=3 line_type=Y_axis
1504 # OEIS-Other: A163343 planepath=GrayCode,apply_type=FsT,radix=3 line_type=Diagonal
1505 };
1506 }
1507 # { package Math::PlanePath::PeanoDiagonals;
1508 # }
1509 { package Math::PlanePath::WunderlichSerpentine;
1510 sub _NumSeq_X_axis_increasing {
1511 my ($self) = @_;
1512 if ($self->{'radix'} % 2) {
1513 return 1; # odd radix always increasing
1514 }
1515 # FIXME: depends on the serpentine_type bits
1516 return 0;
1517 }
1518 sub _NumSeq_Y_axis_increasing {
1519 my ($self) = @_;
1520 if ($self->{'radix'} % 2) {
1521 return 1; # odd radix always increasing
1522 }
1523 # FIXME: depends on the serpentine_type bits
1524 return 0;
1525 }
1526 }
1527 { package Math::PlanePath::HilbertCurve;
1528 use constant _NumSeq_X_axis_increasing => 1;
1529 use constant _NumSeq_Y_axis_increasing => 1;
1530 use constant _NumSeq_Diagonal_increasing => 1;
1531  
1532 use constant _NumSeq_N_oeis_anum =>
1533 { '' =>
1534 { X_axis => 'A163482',
1535 Y_axis => 'A163483',
1536 Diagonal => 'A062880', # base 4 digits 0,2 only
1537 # OEIS-Catalogue: A163482 planepath=HilbertCurve
1538 # OEIS-Catalogue: A163483 planepath=HilbertCurve line_type=Y_axis
1539 # OEIS-Other: A062880 planepath=HilbertCurve line_type=Diagonal
1540 },
1541 };
1542 }
1543 { package Math::PlanePath::HilbertSides;
1544 use constant _NumSeq_X_axis_increasing => 1;
1545 use constant _NumSeq_Y_axis_increasing => 1;
1546 use constant _NumSeq_Diagonal_increasing => 1;
1547  
1548 use constant _NumSeq_N_oeis_anum =>
1549 { '' =>
1550 { Diagonal => 'A062880', # base 4 digits 0,2 only
1551 # OEIS-Other: A062880 planepath=HilbertSides line_type=Diagonal
1552 },
1553 };
1554 }
1555 { package Math::PlanePath::HilbertSpiral;
1556 use constant _NumSeq_Diagonal_increasing => 1;
1557 use constant _NumSeq_Diagonal_SW_increasing => 1;
1558 }
1559 { package Math::PlanePath::ZOrderCurve;
1560 use constant _NumSeq_X_axis_increasing => 1;
1561 use constant _NumSeq_Y_axis_increasing => 1;
1562 use constant _NumSeq_Diagonal_increasing => 1;
1563  
1564 use constant _NumSeq_N_oeis_anum =>
1565 { 'radix=2' =>
1566 { X_axis => 'A000695', # base 4 digits 0,1 only (RadixConversion)
1567 Y_axis => 'A062880', # base 4 digits 0,2 only
1568 Diagonal => 'A001196', # base 4 digits 0,3 only
1569 # OEIS-Other: A000695 planepath=ZOrderCurve
1570 # OEIS-Catalogue: A062880 planepath=ZOrderCurve line_type=Y_axis
1571 # OEIS-Catalogue: A001196 planepath=ZOrderCurve line_type=Diagonal
1572 },
1573 'radix=3' =>
1574 { X_axis => 'A037314', # base 9 digits 0,1,2 only
1575 Diagonal => 'A338086', # base 9 digits 0,4,8 only
1576 # OEIS-Catalogue: A037314 planepath=ZOrderCurve,radix=3
1577 # OEIS-Catalogue: A338086 planepath=ZOrderCurve,radix=3 line_type=Diagonal
1578 },
1579 'radix=3,i_start=1' =>
1580 { Y_axis => 'A208665', # base 9 digits 0,3,6 only, starting OFFSET=1 value=3
1581 # OEIS-Catalogue: A208665 planepath=ZOrderCurve,radix=3 i_start=1 line_type=Y_axis
1582  
1583 # ZOrderCurve dir=2 radix,3: match 6,27,30,33,54,57,60,243,246,249,270,273,276,297,300
1584 # A208665 Numbers that match odd ternary polynomials; see Comments.
1585 # A208665 ,3,6,27,30,33,54,57,60,243,246,249,270,273,276,297,300,303,486,489,492,513,516,519,540,543,546,2187,2190,2193,2214,2217,2220,2241,2244,2247,2430,2433,2436,2457,2460,2463,2484,2487,2490,2673,2676,2679,
1586 # base 9 digits 0,3,6 only
1587 },
1588 'radix=10' =>
1589 { X_axis => 'A051022', # base 10 insert 0s, for digits 0 to 9 base 100
1590 Diagonal => 'A338754', # base 10 duplicate digits
1591 # OEIS-Catalogue: A051022 planepath=ZOrderCurve,radix=10
1592 # OEIS-Catalogue: A338754 planepath=ZOrderCurve,radix=10 line_type=Diagonal
1593 },
1594 };
1595 }
1596 { package Math::PlanePath::GrayCode;
1597  
1598 # X axis increasing for:
1599 # radix=2 TsF,Fs
1600 # radix=3 reflected TsF,FsT
1601 # radix=3 modular TsF,Fs
1602 # radix=4 reflected TsF,Fs
1603 # radix=4 modular TsF,Fs
1604 # radix=5 reflected TsF,FsT
1605 # radix=5 modular TsF,Fs
1606 #
1607 sub _NumSeq_X_axis_increasing {
1608 my ($self) = @_;
1609 if ($self->{'gray_type'} eq 'modular' || $self->{'radix'} == 2) {
1610 return ($self->{'apply_type'} eq 'TsF'
1611 || $self->{'apply_type'} eq 'Fs');
1612 }
1613 if ($self->{'radix'} & 1) {
1614 return ($self->{'apply_type'} eq 'TsF'
1615 || $self->{'apply_type'} eq 'FsT');
1616 } else {
1617 return ($self->{'apply_type'} eq 'TsF'
1618 || $self->{'apply_type'} eq 'Fs');
1619 }
1620 }
1621 *_NumSeq_Y_axis_increasing = \&_NumSeq_X_axis_increasing;
1622  
1623 # Diagonal increasing for:
1624 # radix=2 FsT,Ts
1625 # radix=3 reflected Ts,Fs
1626 # radix=3 modular FsT
1627 # radix=4 reflected FsT,Ts
1628 # radix=4 modular FsT
1629 # radix=5 reflected Ts,Fs
1630 # radix=5 modular FsT
1631 sub _NumSeq_Diagonal_increasing {
1632 my ($self) = @_;
1633 if ($self->{'radix'} & 1) {
1634 if ($self->{'gray_type'} eq 'modular') {
1635 return ($self->{'apply_type'} eq 'FsT'); # odd modular
1636 } else {
1637 return ($self->{'apply_type'} eq 'Ts'
1638 || $self->{'apply_type'} eq 'Fs'); # odd reflected
1639 }
1640 }
1641 if ($self->{'gray_type'} eq 'reflected' || $self->{'radix'} == 2) {
1642 return ($self->{'apply_type'} eq 'FsT'
1643 || $self->{'apply_type'} eq 'Ts'); # even reflected
1644 } else {
1645 return ($self->{'apply_type'} eq 'FsT'); # even modular
1646 }
1647 }
1648  
1649 use constant _NumSeq_N_oeis_anum =>
1650 {
1651 'apply_type=TsF,gray_type=reflected,radix=3' =>
1652 (Math::PlanePath::PeanoCurve->_NumSeq_N_oeis_anum->{'radix=3'}
1653 || die "Oops, SquareSpiral NumSeq PlanePathN not found"),
1654 'apply_type=FsT,gray_type=reflected,radix=3' =>
1655 (Math::PlanePath::PeanoCurve->_NumSeq_N_oeis_anum->{'radix=3'}
1656 || die "Oops, SquareSpiral NumSeq PlanePathN not found"),
1657  
1658 # GrayCode radix=2 TsF==Fs reflected==modular
1659 do {
1660 my $href =
1661 { Y_axis => 'A001196', # base 4 digits 0,3 only
1662 };
1663 ('apply_type=TsF,gray_type=reflected,radix=2' => $href,
1664 'apply_type=Fs,gray_type=reflected,radix=2' => $href,
1665 'apply_type=TsF,gray_type=modular,radix=2' => $href,
1666 'apply_type=Fs,gray_type=modular,radix=2' => $href,
1667 );
1668 # OEIS-Other: A001196 planepath=GrayCode,apply_type=TsF line_type=Y_axis
1669 # OEIS-Other: A001196 planepath=GrayCode,apply_type=Fs line_type=Y_axis
1670 # OEIS-Other: A001196 planepath=GrayCode,apply_type=TsF,gray_type=modular line_type=Y_axis
1671 # OEIS-Other: A001196 planepath=GrayCode,apply_type=Fs,gray_type=modular line_type=Y_axis
1672 },
1673 # GrayCode radix=2 Ts==FsT reflected==modular
1674 do {
1675 my $href =
1676 { Diagonal => 'A062880', # base 4 digits 0,2 only
1677 };
1678 ('apply_type=Ts,gray_type=reflected,radix=2' => $href,
1679 'apply_type=Ts,gray_type=modular,radix=2' => $href,
1680 'apply_type=FsT,gray_type=reflected,radix=2' => $href,
1681 'apply_type=FsT,gray_type=modular,radix=2' => $href,
1682 );
1683 # OEIS-Other: A062880 planepath=GrayCode,apply_type=Ts line_type=Diagonal
1684 # OEIS-Other: A062880 planepath=GrayCode,apply_type=Ts,gray_type=modular line_type=Diagonal
1685 # OEIS-Other: A062880 planepath=GrayCode,apply_type=FsT line_type=Diagonal
1686 # OEIS-Other: A062880 planepath=GrayCode,apply_type=FsT,gray_type=modular line_type=Diagonal
1687 },
1688  
1689 # GrayCode radix=3 sT==sF reflected
1690 # N split then toGray giving Y=0 means N ternary 010202 etc
1691 # N split then toGray giving X=Y means N ternary pairs 112200
1692 do {
1693 my $href =
1694 { X_axis => 'A163344', # central Peano/4, base9 digits 0,1,2 only
1695 Diagonal => 'A163343', # central diagonal of Peano, base9 0,4,8
1696 };
1697 ('apply_type=sT,gray_type=reflected,radix=3' => $href,
1698 'apply_type=sF,gray_type=reflected,radix=3' => $href,
1699 );
1700 # OEIS-Catalogue: A163344 planepath=GrayCode,apply_type=sT,radix=3
1701 # OEIS-Other: A163344 planepath=GrayCode,apply_type=sF,radix=3
1702  
1703 # OEIS-Other: A163343 planepath=GrayCode,apply_type=sT,radix=3 line_type=Diagonal
1704 # OEIS-Other: A163343 planepath=GrayCode,apply_type=sF,radix=3 line_type=Diagonal
1705 },
1706  
1707 'apply_type=FsT,gray_type=modular,radix=3,i_start=1' =>
1708 { Diagonal => 'A208665', # base 9 digits 0,3,6
1709 # OEIS-Other: A208665 planepath=GrayCode,apply_type=FsT,gray_type=modular,radix=3 line_type=Diagonal i_start=1
1710 },
1711 };
1712 }
1713 # { package Math::PlanePath::ImaginaryBase;
1714 # }
1715 { package Math::PlanePath::ImaginaryHalf;
1716 use constant _NumSeq_Y_axis_increasing => 1;
1717  
1718 use constant _NumSeq_N_oeis_anum =>
1719 { 'radix=2,digit_order=YXX' =>
1720 { Y_axis => 'A033045', # base 8 digits 0,1 only
1721 # OEIS-Other: A033045 planepath=ImaginaryHalf,digit_order=YXX line_type=Y_axis
1722 },
1723 'radix=2,digit_order=YXnX' =>
1724 { Y_axis => 'A033045', # base 8 digits 0,1 only
1725 # OEIS-Other: A033045 planepath=ImaginaryHalf,digit_order=YXnX line_type=Y_axis
1726 },
1727 };
1728 }
1729 # { package Math::PlanePath::CubicBase;
1730 # }
1731 { package Math::PlanePath::DekkingCurve;
1732 sub _NumSeq_X_axis_increasing {
1733 my ($self) = @_;
1734 # arms=4 has various interleaving
1735 return $self->{'arms'} < 4;
1736 }
1737 sub _NumSeq_X_neg_increasing {
1738 my ($self) = @_;
1739 # arms=3 has various interleaving
1740 return $self->{'arms'} < 3;
1741 }
1742 sub _NumSeq_Y_axis_increasing {
1743 my ($self) = @_;
1744 # arms=2 has various interleaving
1745 return $self->{'arms'} < 2;
1746 }
1747 sub _NumSeq_Y_neg_increasing {
1748 my ($self) = @_;
1749 # arms=4 has various interleaving
1750 return $self->{'arms'} < 4;
1751 }
1752 }
1753 { package Math::PlanePath::DekkingCentres;
1754 use constant _NumSeq_X_axis_increasing => 1;
1755 use constant _NumSeq_Y_axis_increasing => 1;
1756 }
1757 { package Math::PlanePath::CincoCurve;
1758 use constant _NumSeq_X_axis_increasing => 1;
1759 use constant _NumSeq_Y_axis_increasing => 1;
1760 }
1761 { package Math::PlanePath::BetaOmega;
1762 use constant _NumSeq_X_axis_increasing => 1;
1763 use constant _NumSeq_Y_axis_increasing => 1;
1764 use constant _NumSeq_Y_neg_increasing => 1;
1765 }
1766 { package Math::PlanePath::KochelCurve;
1767 use constant _NumSeq_X_axis_increasing => 1;
1768 use constant _NumSeq_Y_axis_increasing => 1;
1769 }
1770 { package Math::PlanePath::AR2W2Curve;
1771 use constant _NumSeq_X_axis_increasing => 1;
1772 use constant _NumSeq_Y_axis_increasing => 1;
1773 use constant _NumSeq_Diagonal_increasing => 1;
1774 }
1775 { package Math::PlanePath::WunderlichMeander;
1776 use constant _NumSeq_X_axis_increasing => 1;
1777 use constant _NumSeq_Y_axis_increasing => 1;
1778 }
1779 # { package Math::PlanePath::Flowsnake;
1780 # }
1781 # { package Math::PlanePath::FlowsnakeCentres;
1782 # # inherit from Flowsnake
1783 # }
1784 # { package Math::PlanePath::GosperIslands;
1785 # }
1786 # { package Math::PlanePath::GosperSide;
1787 # }
1788 { package Math::PlanePath::KochCurve;
1789 use constant _NumSeq_X_axis_increasing => 1; # when touched
1790 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1791 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1792 }
1793 { package Math::PlanePath::KochPeaks;
1794 use constant _NumSeq_X_axis_increasing => 1; # when touched
1795 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1796 use constant _NumSeq_X_neg_increasing => 1; # when touched
1797 # Diagonal never touched
1798 }
1799 { package Math::PlanePath::KochSnowflakes;
1800 use constant _NumSeq_X_axis_increasing => 1; # when touched
1801 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1802 use constant _NumSeq_X_neg_increasing => 1;
1803 use constant _NumSeq_Y_neg_increasing => 1;
1804 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1805 use constant _NumSeq_Diagonal_NW_increasing => 1;
1806 use constant _NumSeq_Diagonal_SW_increasing => 1;
1807 use constant _NumSeq_Diagonal_SE_increasing => 1;
1808 }
1809 { package Math::PlanePath::KochSquareflakes;
1810 use constant _NumSeq_X_axis_increasing => 1; # when touched
1811 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1812 use constant _NumSeq_X_neg_increasing => 1;
1813 use constant _NumSeq_Y_neg_increasing => 1;
1814 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1815 use constant _NumSeq_Diagonal_NW_increasing => 1;
1816 use constant _NumSeq_Diagonal_SW_increasing => 1;
1817 use constant _NumSeq_Diagonal_SE_increasing => 1;
1818 }
1819 { package Math::PlanePath::QuadricCurve;
1820 use constant _NumSeq_X_axis_increasing => 1; # when touched
1821 use constant _NumSeq_Diagonal_increasing => 1; # two values only
1822 }
1823 { package Math::PlanePath::QuadricIslands;
1824 # FIXME: pred() on Diagonal_SW doesn't notice 0.5 square
1825 use constant _NumSeq_X_axis_increasing => 1; # when touched
1826 use constant _NumSeq_Y_axis_increasing => 1;
1827  
1828 use constant _NumSeq_X_neg_increasing => 1;
1829  
1830 use constant _NumSeq_Y_neg_increasing => 0;
1831 use constant _NumSeq_Y_neg_increasing_from_i => 1; # after 3,2,8
1832 use constant _NumSeq_Y_neg_min => 2; # at X=-1,Y=0 rather than X=0,Y=0
1833 use constant _NumSeq_Diagonal_SW_increasing => 0;
1834 use constant _NumSeq_Diagonal_SW_min => 1;
1835 }
1836 { package Math::PlanePath::SierpinskiTriangle;
1837 use constant _NumSeq_X_axis_increasing => 1; # for "diagonal" style
1838 use constant _NumSeq_Y_axis_increasing => 1;
1839 use constant _NumSeq_Diagonal_increasing => 1;
1840 use constant _NumSeq_Diagonal_NW_increasing => 1;
1841  
1842 # low 10111=23 increment to 11000=24
1843 # 10111 ones=4 width=2^4
1844  
1845 # cf A160722 is 3*A006046-2*n, drawing three Sierpinski triangles
1846 # http://www.polprimos.com/imagenespub/polca722.jpg
1847 #
1848 use constant _NumSeq_N_oeis_anum =>
1849 {
1850 #---------
1851 # i_start=0, n_start=0
1852  
1853 'align=triangular,n_start=0' =>
1854 { Diagonal_NW => 'A006046',
1855 Depth_start => 'A006046',
1856 # OEIS-Other: A006046 planepath=SierpinskiTriangle line_type=Diagonal_NW
1857 # OEIS-Other: A006046 planepath=SierpinskiTriangle line_type=Depth_start
1858 },
1859 'align=right,n_start=0' =>
1860 { Y_axis => 'A006046',
1861 Depth_start => 'A006046',
1862 # OEIS-Catalogue: A006046 planepath=SierpinskiTriangle,align=diagonal,n_start=0 line_type=Y_axis
1863 },
1864 'align=left,n_start=0' =>
1865 { Diagonal_NW => 'A006046',
1866 Depth_start => 'A006046',
1867 # OEIS-Other: A006046 planepath=SierpinskiTriangle,align=left,n_start=0 line_type=Diagonal_NW
1868 },
1869 'align=diagonal,n_start=0' =>
1870 { Y_axis => 'A006046',
1871 Depth_start => 'A006046',
1872 # OEIS-Other: A006046 planepath=SierpinskiTriangle,align=diagonal,n_start=0 line_type=Y_axis
1873 },
1874  
1875 #---------
1876 # i_start=1, n_start=0
1877  
1878 # starting OFFSET=1 value=2,4,8,10 so missing N=0 at Y=0, hence i_start=1
1879 'align=triangular,n_start=0,i_start=1' =>
1880 { Diagonal => 'A074330',
1881 Depth_end => 'A074330',
1882 # OEIS-Catalogue: A074330 planepath=SierpinskiTriangle line_type=Diagonal i_start=1
1883 # OEIS-Other: A074330 planepath=SierpinskiTriangle line_type=Depth_end i_start=1
1884 },
1885 'align=right,n_start=0,i_start=1' =>
1886 { Diagonal => 'A074330',
1887 Depth_end => 'A074330',
1888 # OEIS-Other: A074330 planepath=SierpinskiTriangle,align=right line_type=Diagonal i_start=1
1889 },
1890 'align=left,n_start=0,i_start=1' =>
1891 { Y_axis => 'A074330',
1892 Depth_end => 'A074330',
1893 # OEIS-Other: A074330 planepath=SierpinskiTriangle,align=left line_type=Y_axis i_start=1
1894 },
1895 'align=diagonal,n_start=0,i_start=1' =>
1896 { X_axis => 'A074330',
1897 Depth_end => 'A074330',
1898 # OEIS-Other: A074330 planepath=SierpinskiTriangle,align=diagonal i_start=1
1899 },
1900 };
1901 }
1902 { package Math::PlanePath::SierpinskiArrowhead;
1903 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1904 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1905 use constant _NumSeq_Diagonal_NW_increasing => 1;
1906 # align="diagonal" is X increasing, other align is single origin point only
1907 use constant _NumSeq_X_axis_increasing => 1;
1908 }
1909 { package Math::PlanePath::SierpinskiArrowheadCentres;
1910 use constant _NumSeq_Y_axis_increasing => 1; # never touched ?
1911 use constant _NumSeq_Diagonal_increasing => 1;
1912 use constant _NumSeq_Diagonal_NW_increasing => 1;
1913 # align="diagonal" is X increasing, other align is single origin point only
1914 use constant _NumSeq_X_axis_increasing => 1;
1915 }
1916 { package Math::PlanePath::SierpinskiCurve;
1917 use constant _NumSeq_X_axis_increasing => 1; # when touched
1918 use constant _NumSeq_X_axis_i_start => 1; # but not all cells visited
1919  
1920 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1921 use constant _NumSeq_Y_axis_i_start => 1; # but not all cells visited
1922  
1923 use constant _NumSeq_X_neg_increasing => 1; # arms
1924 use constant _NumSeq_Y_neg_increasing => 1; # arms
1925  
1926 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1927 use constant _NumSeq_Diagonal_NW_increasing => 1;
1928  
1929 use constant _NumSeq_Diagonal_SW_increasing => 1;
1930 use constant _NumSeq_Diagonal_SE_increasing => 1;
1931 }
1932 { package Math::PlanePath::SierpinskiCurveStair;
1933 use constant _NumSeq_X_axis_increasing => 1; # when touched
1934 use constant _NumSeq_Y_axis_increasing => 1; # when touched
1935 use constant _NumSeq_X_neg_increasing => 1; # arms
1936 use constant _NumSeq_Y_neg_increasing => 1; # arms
1937 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1938 use constant _NumSeq_Diagonal_NW_increasing => 1;
1939 use constant _NumSeq_Diagonal_SW_increasing => 1;
1940 use constant _NumSeq_Diagonal_SE_increasing => 1;
1941 }
1942 { package Math::PlanePath::HIndexing;
1943 use constant _NumSeq_X_axis_increasing => 1; # when touched
1944 use constant _NumSeq_Y_axis_increasing => 1;
1945 use constant _NumSeq_Diagonal_increasing => 1; # when touched
1946 }
1947 # { package Math::PlanePath::DragonCurve;
1948 # }
1949 # { package Math::PlanePath::DragonRounded;
1950 # }
1951 # { package Math::PlanePath::DragonMidpoint;
1952 # }
1953 { package Math::PlanePath::AlternatePaper;
1954 use constant _NumSeq_X_axis_increasing => 1;
1955 use constant _NumSeq_Y_axis_increasing => 1;
1956 use constant _NumSeq_Diagonal_increasing => 1;
1957 use constant _NumSeq_Diagonal_NW_increasing => 1; # arms
1958 use constant _NumSeq_Diagonal_SW_increasing => 1;
1959 use constant _NumSeq_Diagonal_SE_increasing => 1;
1960 # selecting the smaller N on the negative axes gives increasing, maybe
1961 use constant _NumSeq_X_neg_increasing => 1;
1962 use constant _NumSeq_Y_neg_increasing => 1;
1963  
1964 use constant _NumSeq_N_oeis_anum =>
1965 { 'arms=1' =>
1966 { X_axis => 'A000695', # base 4 digits 0,1 only
1967 Diagonal => 'A062880', # base 4 digits 0,2 only
1968 # OEIS-Other: A000695 planepath=AlternatePaper
1969 # OEIS-Other: A062880 planepath=AlternatePaper line_type=Diagonal
1970 },
1971 # FIXME: not sure what to do when multiple-visited points on axes
1972 # 'arms=2' =>
1973 # { X_axis => 'A062880', # base 4 digits 0,2 only
1974 # Y_axis => 'A145812', # base 4 digits 0,2 only except low digit 1,3 only
1975 # # OEIS-Other: A062880 planepath=AlternatePaper,arms=2
1976 # # OEIS-Catalogue: A145812 planepath=AlternatePaper,arms=2 line_type=Y_axis
1977 # },
1978 # 'arms=3' =>
1979 # { X_axis => 'A001196', # base 4 digits 0,3 only
1980 # # OEIS-Other: A001196 planepath=AlternatePaper,arms=3
1981 # },
1982 #
1983 # alt paper arms=4 diagonal, arms=8 x axis
1984 # A127988 # base 8 digits 0,4 only
1985 };
1986 }
1987 { package Math::PlanePath::AlternatePaperMidpoint;
1988 use constant _NumSeq_X_axis_increasing => 1;
1989 use constant _NumSeq_Y_axis_increasing => 1;
1990 use constant _NumSeq_Diagonal_increasing => 1;
1991 use constant _NumSeq_Diagonal_NW_increasing => 1; # arms
1992 use constant _NumSeq_Diagonal_SE_increasing => 1; # arms
1993 }
1994 # { package Math::PlanePath::TerdragonCurve;
1995 # }
1996 # { package Math::PlanePath::TerdragonRounded;
1997 # }
1998 # { package Math::PlanePath::TerdragonMidpoint;
1999 # }
2000 # { package Math::PlanePath::AlternateTerdragon;
2001 # }
2002 # { package Math::PlanePath::R5DragonCurve;
2003 # }
2004 # { package Math::PlanePath::R5DragonMidpoint;
2005 # }
2006 # { package Math::PlanePath::CCurve;
2007 # }
2008 # { package Math::PlanePath::ComplexPlus;
2009 # }
2010 { package Math::PlanePath::ComplexMinus;
2011 use constant _NumSeq_N_oeis_anum =>
2012 { 'realpart=1' =>
2013 { X_axis => 'A066321', # binary base i-1
2014 X_neg => 'A256441', # binary base i-1
2015 # OEIS-Catalogue: A066321 planepath=ComplexMinus
2016 # OEIS-Catalogue: A256441 planepath=ComplexMinus line_type=X_neg
2017 # cf A066323 count of 1-bits in N on X axis
2018 },
2019 };
2020 }
2021 # { package Math::PlanePath::ComplexRevolving;
2022 # }
2023 { package Math::PlanePath::Rows;
2024 use constant _NumSeq_X_axis_increasing => 1;
2025 use constant _NumSeq_Y_axis_increasing => 1;
2026 use constant _NumSeq_Diagonal_increasing => 1;
2027 use constant _NumSeq_Y_neg_min => undef; # negatives
2028 use constant _NumSeq_Y_neg_max => 1; # negatives
2029  
2030 # secret negatives
2031 # (w-1)*(w-1)-1
2032 # = w^2-2w+1-1
2033 # = w(w-2)
2034 sub _NumSeq_Diagonal_SE_min {
2035 my ($self) = @_;
2036 return ($self->{'width'}-2)*$self->{'width'};
2037 }
2038  
2039 use constant _NumSeq_N_oeis_anum =>
2040 {
2041 'n_start=0,width=1' =>
2042 { Y_axis => 'A001477', # integers 0,1,2,3,etc
2043 # OEIS-Other: A001477 planepath=Rows,width=1,n_start=0 line_type=Y_axis
2044 },
2045 'n_start=1,width=2' =>
2046 { Y_axis => 'A005408', # odd 2n+1
2047 # OEIS-Other: A005408 planepath=Rows,width=2 line_type=Y_axis
2048 },
2049 'n_start=1,width=3' =>
2050 { Y_axis => 'A016777', # 3n+1
2051 # OEIS-Catalogue: A016777 planepath=Rows,width=3 line_type=Y_axis
2052 },
2053 'n_start=1,width=4' =>
2054 { Y_axis => 'A016813', # 4n+1
2055 # OEIS-Catalogue: A016813 planepath=Rows,width=4 line_type=Y_axis
2056 },
2057  
2058 'n_start=1,width=5' =>
2059 { Y_axis => 'A016861', # 5n+1
2060 # OEIS-Catalogue: A016861 planepath=Rows,width=5 line_type=Y_axis
2061 },
2062 'n_start=1,width=6' =>
2063 { Y_axis => 'A016921', # 6n+1
2064 # OEIS-Catalogue: A016921 planepath=Rows,width=6 line_type=Y_axis
2065 },
2066 'n_start=1,width=7' =>
2067 { Y_axis => 'A016993', # 7n+1
2068 # OEIS-Catalogue: A016993 planepath=Rows,width=7 line_type=Y_axis
2069 },
2070 };
2071 }
2072 { package Math::PlanePath::Columns;
2073 use constant _NumSeq_X_axis_increasing => 1;
2074 use constant _NumSeq_Y_axis_increasing => 1;
2075 use constant _NumSeq_Diagonal_increasing => 1;
2076 use constant _NumSeq_X_neg_min => undef; # negatives
2077 use constant _NumSeq_X_neg_max => 1; # negatives
2078  
2079 sub _NumSeq_Diagonal_NW_min {
2080 my ($self) = @_;
2081 # secret negatives
2082 return ($self->{'height'}-2)*$self->{'height'};
2083 }
2084 use constant _NumSeq_N_oeis_anum =>
2085 {
2086 'n_start=0,height=1' =>
2087 { X_axis => 'A001477', # integers 0,1,2,3,etc
2088 # OEIS-Other: A001477 planepath=Columns,height=1,n_start=0
2089 },
2090 'n_start=1,height=2' =>
2091 { X_axis => 'A005408', # odd 2n+1
2092 # OEIS-Other: A005408 planepath=Columns,height=2
2093 },
2094 'n_start=1,height=3' =>
2095 { X_axis => 'A016777', # 3n+1
2096 # OEIS-Other: A016777 planepath=Columns,height=3
2097 },
2098 'n_start=1,height=4' =>
2099 { X_axis => 'A016813', # 4n+1
2100 # OEIS-Other: A016813 planepath=Columns,height=4
2101 },
2102 'n_start=1,height=5' =>
2103 { X_axis => 'A016861', # 5n+1
2104 # OEIS-Other: A016861 planepath=Columns,height=5
2105 },
2106 'n_start=1,height=6' =>
2107 { X_axis => 'A016921', # 6n+1
2108 # OEIS-Other: A016921 planepath=Columns,height=6
2109 },
2110 'n_start=1,height=7' =>
2111 { X_axis => 'A016993', # 7n+1
2112 # OEIS-Other: A016993 planepath=Columns,height=7
2113 },
2114 };
2115 }
2116 { package Math::PlanePath::Diagonals;
2117 use constant _NumSeq_X_axis_increasing => 1;
2118 use constant _NumSeq_Y_axis_increasing => 1;
2119 use constant _NumSeq_Diagonal_increasing => 1;
2120  
2121 use constant _NumSeq_N_oeis_anum =>
2122 { 'direction=down,n_start=1,x_start=0,y_start=0' =>
2123 {
2124 # Diagonals X_axis -- triangular 1,3,6,etc, but starting i=0 value=1
2125 Y_axis => 'A000124', # triangular+1 = n*(n+1)/2+1
2126 Diagonal => 'A001844', # centred squares 2n(n+1)+1
2127 # OEIS-Catalogue: A000124 planepath=Diagonals line_type=Y_axis
2128 # OEIS-Catalogue: A001844 planepath=Diagonals line_type=Diagonal
2129 },
2130 'direction=up,n_start=1,x_start=0,y_start=0' =>
2131 {
2132 X_axis => 'A000124', # triangular+1 = n*(n+1)/2+1
2133 Diagonal => 'A001844', # centred squares 2n(n+1)+1
2134 # OEIS-Other: A000124 planepath=Diagonals,direction=up
2135 # OEIS-Other: A001844 planepath=Diagonals,direction=up line_type=Diagonal
2136 },
2137  
2138 'direction=down,n_start=0,x_start=0,y_start=0' =>
2139 {
2140 X_axis => 'A000096', # n*(n+3)/2
2141 Y_axis => 'A000217', # triangular n*(n+1)/2
2142 # OEIS-Other: A000096 planepath=Diagonals,n_start=0
2143 # OEIS-Other: A000217 planepath=Diagonals,n_start=0 line_type=Y_axis
2144 },
2145 'direction=up,n_start=0,x_start=0,y_start=0' =>
2146 {
2147 X_axis => 'A000217', # triangular n*(n+1)/2
2148 Y_axis => 'A000096', # n*(n+3)/2
2149 # OEIS-Other: A000217 planepath=Diagonals,direction=up,n_start=0
2150 # OEIS-Other: A000096 planepath=Diagonals,direction=up,n_start=0 line_type=Y_axis
2151 },
2152 };
2153 }
2154 { package Math::PlanePath::DiagonalsAlternating;
2155 use constant _NumSeq_X_axis_increasing => 1;
2156 use constant _NumSeq_Y_axis_increasing => 1;
2157 use constant _NumSeq_Diagonal_increasing => 1;
2158  
2159 use constant _NumSeq_N_oeis_anum =>
2160 { 'n_start=1' =>
2161 { Diagonal => 'A001844', # centred squares 2n(n+1)+1
2162 # OEIS-Other: A001844 planepath=DiagonalsAlternating line_type=Diagonal
2163  
2164 # Not quite, extra initial 1 or 0
2165 # X_axis => 'A128918',
2166 # Y_axis => 'A131179',
2167 },
2168 'n_start=0' =>
2169 { Diagonal => 'A046092', # 2*triangular
2170 # OEIS-Other: A046092 planepath=DiagonalsAlternating,n_start=0 line_type=Diagonal
2171 },
2172 };
2173 }
2174 { package Math::PlanePath::DiagonalsOctant;
2175 use constant _NumSeq_X_axis_increasing => 1;
2176 use constant _NumSeq_Y_axis_increasing => 1;
2177 use constant _NumSeq_Diagonal_increasing => 1;
2178  
2179 use constant _NumSeq_N_oeis_anum =>
2180 {
2181 # 'direction=down,n_start=1' =>
2182 # {
2183 # Not quite, starting i=0 for square=1 cf A000290 starts 0
2184 # # Diagonal => 'A000290', # squares
2185 #
2186 # Not quite, A033638 extra initial 1
2187 # # Y_axis => 'A033638', # quarter squares + 1, 1,1,2,3,5,7,10,13
2188 # }
2189  
2190 # 'direction=up,n_start=1' =>
2191 # {
2192 # # Not quite, A002061 extra initial 1
2193 # # Diagonal => 'A002061', # 1,1,3,7,13,21,31,43
2194 # }
2195  
2196 'direction=down,n_start=0' =>
2197 { Diagonal => 'A005563', # n*(n+2) 0,3,8,15,24
2198 # OEIS-Other: A005563 planepath=DiagonalsOctant,n_start=0 line_type=Diagonal
2199  
2200 # # Not quite, extra initial 0
2201 # # Y_axis => 'A002620', # quarter squares 0,0,1,2,4,6,9,12,
2202 },
2203  
2204 'direction=up,n_start=0' =>
2205 { Diagonal => 'A002378', # pronic 0,2,6,12,20
2206 # OEIS-Other: A002378 planepath=DiagonalsOctant,direction=up,n_start=0 line_type=Diagonal
2207  
2208 # # Not quite, starts n=1 value=0 whereas start Y=0 value=0 here
2209 # # Y_axis => 'A024206', # 0,1,3,5,8,11,15
2210 },
2211 };
2212 }
2213 { package Math::PlanePath::MPeaks;
2214 use constant _NumSeq_X_axis_increasing => 1;
2215 use constant _NumSeq_Y_axis_increasing => 1;
2216 use constant _NumSeq_X_neg_increasing => 0;
2217 use constant _NumSeq_X_neg_increasing_from_i => 1;
2218 use constant _NumSeq_X_neg_min => 1; # at X=-1,Y=0 rather than X=0,Y=0
2219 use constant _NumSeq_Diagonal_increasing => 1;
2220 use constant _NumSeq_Diagonal_NW_increasing_from_i => 1;
2221 use constant _NumSeq_Diagonal_NW_min => 2; # at X=-1,Y=1
2222  
2223 # MPeaks -- X_axis A045944 matchstick n(3n+2) but initial N=3
2224 # MPeaks -- Diagonal,Y_axis hexagonal first,second spoke, but starting
2225 # from 3
2226 }
2227 { package Math::PlanePath::Staircase;
2228 use constant _NumSeq_X_axis_increasing => 1;
2229 use constant _NumSeq_Diagonal_increasing => 1;
2230  
2231 use constant _NumSeq_N_oeis_anum =>
2232 {
2233 'n_start=1' =>
2234 { Diagonal => 'A084849',
2235 # OEIS-Other: A084849 planepath=Staircase line_type=Diagonal
2236 },
2237  
2238 'n_start=0' =>
2239 { Diagonal => 'A014105', # second hexagonals
2240 # OEIS-Other: A014105 planepath=Staircase,n_start=0 line_type=Diagonal
2241 },
2242  
2243 'n_start=2' =>
2244 { Diagonal => 'A096376',
2245 # OEIS-Catalogue: A096376 planepath=Staircase,n_start=2 line_type=Diagonal
2246  
2247 # Not quite, A128918 has extra initial 1,1
2248 # X_axis => 'A128918',
2249 },
2250 };
2251 }
2252 { package Math::PlanePath::StaircaseAlternating;
2253 sub _NumSeq_X_axis_increasing {
2254 my ($self) = @_;
2255 return ($self->{'end_type'} eq 'square'
2256 ? 1
2257 : 0); # backs-up
2258 }
2259 *_NumSeq_Y_axis_increasing = \&_NumSeq_X_axis_increasing;
2260 use constant _NumSeq_Diagonal_increasing => 1;
2261  
2262 use constant _NumSeq_N_oeis_anum =>
2263 {
2264 'end_type=jump,n_start=1' =>
2265 { Diagonal => 'A084849',
2266 # OEIS-Other: A084849 planepath=StaircaseAlternating line_type=Diagonal
2267 },
2268 'end_type=jump,n_start=0' =>
2269 { Diagonal => 'A014105', # second hexagonals
2270 # OEIS-Other: A014105 planepath=StaircaseAlternating,n_start=0 line_type=Diagonal
2271 },
2272 'end_type=jump,n_start=2' =>
2273 { Diagonal => 'A096376',
2274 # OEIS-Other: A096376 planepath=StaircaseAlternating,n_start=2 line_type=Diagonal
2275 },
2276  
2277 'end_type=square,n_start=1' =>
2278 { Diagonal => 'A058331',
2279 # OEIS-Other: A058331 planepath=StaircaseAlternating,end_type=square line_type=Diagonal
2280 },
2281 'end_type=square,n_start=0' =>
2282 { Diagonal => 'A001105',
2283 # OEIS-Other: A001105 planepath=StaircaseAlternating,end_type=square,n_start=0 line_type=Diagonal
2284 },
2285 };
2286 }
2287 { package Math::PlanePath::Corner;
2288 use constant _NumSeq_X_axis_increasing => 1;
2289 use constant _NumSeq_Y_axis_increasing => 1;
2290 use constant _NumSeq_Diagonal_increasing => 1;
2291  
2292 use constant _NumSeq_N_oeis_anum =>
2293 { 'wider=0,n_start=1' =>
2294 { Y_axis => 'A002522', # n^2+1
2295 # OEIS-Other: A002522 planepath=Corner line_type=Y_axis
2296 },
2297 'wider=0,n_start=0' =>
2298 { X_axis => 'A005563', # (n+1)^2-1
2299 Y_axis => 'A000290', # squares
2300 Diagonal => 'A002378', # pronic
2301 # OEIS-Other: A005563 planepath=Corner,n_start=0
2302 # OEIS-Other: A000290 planepath=Corner,n_start=0 line_type=Y_axis
2303 # OEIS-Other: A002378 planepath=Corner,n_start=0 line_type=Diagonal
2304 },
2305 'wider=0,n_start=2' =>
2306 { Y_axis => 'A059100', # n^2+2
2307 Diagonal => 'A014206', # pronic+2
2308 # OEIS-Catalogue: A059100 planepath=Corner,n_start=2 line_type=Y_axis
2309 # OEIS-Catalogue: A014206 planepath=Corner,n_start=2 line_type=Diagonal
2310 },
2311  
2312 'wider=1,n_start=0' =>
2313 { Y_axis => 'A002378', # pronic
2314 Diagonal => 'A005563', # (n+1)^2-1
2315 # OEIS-Other: A002378 planepath=Corner,wider=1,n_start=0 line_type=Y_axis
2316 # OEIS-Other: A005563 planepath=Corner,wider=1,n_start=0 line_type=Diagonal
2317 },
2318 'wider=1,n_start=2' =>
2319 { Y_axis => 'A014206', # pronic+2
2320 # OEIS-Other: A014206 planepath=Corner,wider=1,n_start=2 line_type=Y_axis
2321 },
2322  
2323 'wider=2,n_start=0' =>
2324 { Y_axis => 'A005563', # (n+1)^2-1
2325 Diagonal => 'A028552', # n(n+3)
2326 # OEIS-Other: A005563 planepath=Corner,wider=2,n_start=0 line_type=Y_axis
2327 # OEIS-Catalogue: A028552 planepath=Corner,wider=2,n_start=0 line_type=Diagonal
2328 },
2329 'wider=2,n_start=1' =>
2330 { Diagonal => 'A028387', # n(n+3)+1 = n + (n+1)^2
2331 # OEIS-Catalogue: A028387 planepath=Corner,wider=2,n_start=1 line_type=Diagonal
2332 },
2333  
2334 'wider=3,n_start=0' =>
2335 { Y_axis => 'A028552', # n(n+3)
2336 # OEIS-Other: A028552 planepath=Corner,wider=3,n_start=0 line_type=Y_axis
2337 },
2338 };
2339 }
2340 { package Math::PlanePath::CornerAlternating;
2341 use constant _NumSeq_X_axis_increasing => 1;
2342 use constant _NumSeq_Y_axis_increasing => 1;
2343 use constant _NumSeq_Diagonal_increasing => 1;
2344  
2345 use constant _NumSeq_N_oeis_anum =>
2346 { 'wider=0,n_start=1' =>
2347 { X_axis => 'A081346', # picture in A081344
2348 Y_axis => 'A081345',
2349 # OEIS-Catalogue: A081346 planepath=CornerAlternating
2350 # OEIS-Catalogue: A081345 planepath=CornerAlternating line_type=Y_axis
2351 },
2352 'wider=0,n_start=0' =>
2353 { Diagonal => 'A002378', # pronic
2354 # OEIS-Other: A002378 planepath=CornerAlternating,n_start=0 line_type=Diagonal
2355 },
2356 'wider=0,n_start=2' =>
2357 { Diagonal => 'A014206', # pronic
2358 # OEIS-Other: A014206 planepath=CornerAlternating,n_start=2 line_type=Diagonal
2359 },
2360  
2361 'wider=1,n_start=1' =>
2362 { X_axis => 'A081347', # maze, picture in A081344
2363 Y_axis => 'A081348',
2364 Diagonal => 'A080335',
2365 # OEIS-Catalogue: A081347 planepath=CornerAlternating,wider=1
2366 # OEIS-Catalogue: A081348 planepath=CornerAlternating,wider=1 line_type=Y_axis
2367 # OEIS-Catalogue: A080335 planepath=CornerAlternating,wider=1 line_type=Diagonal
2368 },
2369  
2370 'wider=2,n_start=1' =>
2371 { X_axis => 'A081350', # another maze, picture in A081349
2372 Y_axis => 'A081351',
2373 Diagonal => 'A081352',
2374 # OEIS-Catalogue: A081350 planepath=CornerAlternating,wider=2
2375 # OEIS-Catalogue: A081351 planepath=CornerAlternating,wider=2 line_type=Y_axis
2376 # OEIS-Catalogue: A081352 planepath=CornerAlternating,wider=2 line_type=Diagonal
2377 },
2378 };
2379 }
2380 { package Math::PlanePath::PyramidRows;
2381 use constant _NumSeq_Y_axis_increasing => 1;
2382 use constant _NumSeq_Diagonal_increasing => 1; # when covered, or single
2383 use constant _NumSeq_Diagonal_NW_increasing => 1;
2384  
2385 use constant _NumSeq_N_oeis_anum =>
2386 {
2387 # PyramidRows step=1
2388 do {
2389 my $href =
2390 { Y_axis => 'A000124', # triangular+1 = n*(n+1)/2+1
2391 };
2392 ('step=1,align=centre,n_start=1' => $href,
2393 'step=1,align=right,n_start=1' => $href);
2394  
2395 # OEIS-Other: A000124 planepath=PyramidRows,step=1 line_type=Y_axis
2396 # OEIS-Other: A000124 planepath=PyramidRows,step=1,align=right line_type=Y_axis
2397 },
2398 'step=1,align=left,n_start=1' =>
2399 { Diagonal_NW => 'A000124', # triangular+1 = n*(n+1)/2+1
2400 # OEIS-Other: A000124 planepath=PyramidRows,step=1,align=left line_type=Diagonal_NW
2401 },
2402 do {
2403 my $href =
2404 { Y_axis => 'A000217', # triangular
2405 };
2406 ('step=1,align=centre,n_start=0' => $href,
2407 'step=1,align=right,n_start=0' => $href);
2408  
2409 # OEIS-Other: A000217 planepath=PyramidRows,step=1,n_start=0 line_type=Y_axis
2410 # OEIS-Other: A000217 planepath=PyramidRows,step=1,align=right,n_start=0 line_type=Y_axis
2411 },
2412  
2413 'step=2,align=centre,n_start=1' =>
2414 { Diagonal_NW => 'A002522', # n^2+1
2415 # OEIS-Other: A002522 planepath=PyramidRows,step=2 line_type=Diagonal_NW
2416  
2417 # Not quite, n_start=1 means squares starting from 1 whereas A000290
2418 # starts from 0
2419 # Diagonal => 'A000290',
2420 },
2421 'step=2,align=centre,n_start=0' =>
2422 { Y_axis => 'A002378', # pronic
2423 Diagonal => 'A005563',
2424 Diagonal_NW => 'A000290', # squares
2425 # OEIS-Other: A002378 planepath=PyramidRows,step=2,n_start=0 line_type=Y_axis
2426 # OEIS-Other: A005563 planepath=PyramidRows,step=2,n_start=0 line_type=Diagonal
2427 # OEIS-Other: A000290 planepath=PyramidRows,step=2,n_start=0 line_type=Diagonal_NW
2428 },
2429 'step=2,align=right,n_start=0' =>
2430 { Y_axis => 'A000290', # squares
2431 Diagonal => 'A002378', # pronic
2432 # OEIS-Other: A000290 planepath=PyramidRows,step=2,align=right,n_start=0 line_type=Y_axis
2433 # OEIS-Other: A002378 planepath=PyramidRows,step=2,align=right,n_start=0 line_type=Diagonal
2434 },
2435 'step=2,align=left,n_start=0' =>
2436 { Y_axis => 'A005563',
2437 Diagonal_NW => 'A002378', # pronic
2438 # OEIS-Other: A005563 planepath=PyramidRows,step=2,align=left,n_start=0 line_type=Y_axis
2439 # OEIS-Other: A002378 planepath=PyramidRows,step=2,align=left,n_start=0 line_type=Diagonal_NW
2440 },
2441 'step=2,align=centre,n_start=2' =>
2442 { Diagonal_NW => 'A059100', # n^2+2
2443 # OEIS-Other: A059100 planepath=PyramidRows,step=2,n_start=2 line_type=Diagonal_NW
2444 },
2445 'step=2,align=right,n_start=2' =>
2446 { Y_axis => 'A059100', # n^2+2
2447 # OEIS-Other: A059100 planepath=PyramidRows,step=2,align=right,n_start=2 line_type=Y_axis
2448 },
2449  
2450 'step=3,align=centre,n_start=1' =>
2451 { Y_axis => 'A104249',
2452 Diagonal_NW => 'A143689',
2453 # OEIS-Catalogue: A104249 planepath=PyramidRows,step=3 line_type=Y_axis
2454 # OEIS-Catalogue: A143689 planepath=PyramidRows,step=3 line_type=Diagonal_NW
2455 # Not quite OFFSET=1 cf start i=0 here
2456 # Diagonal => 'A005448',
2457 # # OEIS-Catalogue: A005448 planepath=PyramidRows,step=3 line_type=Diagonal
2458 },
2459 'step=3,align=right,n_start=1' =>
2460 { Y_axis => 'A143689',
2461 Diagonal => 'A104249',
2462 # OEIS-Other: A143689 planepath=PyramidRows,step=3,align=right line_type=Y_axis
2463 # OEIS-Other: A104249 planepath=PyramidRows,step=3,align=right line_type=Diagonal
2464  
2465 # Not quite OFFSET=1 cf start i=0 here
2466 # Diagonal => 'A005448',
2467 # # OEIS-Catalogue: A005448 planepath=PyramidRows,step=3 line_type=Diagonal
2468 },
2469 'step=3,align=centre,n_start=0' =>
2470 { Y_axis => 'A005449', # second pentagonal n*(3n+1)/2
2471 Diagonal_NW => 'A000326', # pentagonal n(3n-1)/2
2472 # OEIS-Other: A005449 planepath=PyramidRows,step=3,n_start=0 line_type=Y_axis
2473 # OEIS-Other: A000326 planepath=PyramidRows,step=3,n_start=0 line_type=Diagonal_NW
2474 },
2475 'step=3,align=right,n_start=0' =>
2476 { Y_axis => 'A000326', # pentagonal n(3n-1)/2
2477 Diagonal => 'A005449', # second pentagonal n*(3n+1)/2
2478 # OEIS-Other: A000326 planepath=PyramidRows,step=3,align=right,n_start=0 line_type=Y_axis
2479 # OEIS-Other: A005449 planepath=PyramidRows,step=3,align=right,n_start=0 line_type=Diagonal
2480 },
2481  
2482 'step=4,align=centre,n_start=1' =>
2483 { Y_axis => 'A084849',
2484 Diagonal => 'A001844',
2485 Diagonal_NW => 'A058331',
2486 # OEIS-Catalogue: A084849 planepath=PyramidRows,step=4 line_type=Y_axis
2487 # OEIS-Other: A001844 planepath=PyramidRows,step=4 line_type=Diagonal
2488 # OEIS-Other: A058331 planepath=PyramidRows,step=4 line_type=Diagonal_NW
2489 },
2490 'step=4,align=right,n_start=1' =>
2491 { Diagonal => 'A058331',
2492 # OEIS-Other: A058331 planepath=PyramidRows,step=4,align=right line_type=Diagonal
2493 },
2494 'step=4,align=left,n_start=1' =>
2495 { Diagonal_NW => 'A001844',
2496 # OEIS-Other: A001844 planepath=PyramidRows,step=4,align=left line_type=Diagonal_NW
2497 },
2498 'step=4,align=centre,n_start=0' =>
2499 { Y_axis => 'A014105', # second hexagonal
2500 Diagonal => 'A046092', # 4*triangular
2501 Diagonal_NW => 'A001105', # 2*n^2
2502 # OEIS-Other: A014105 planepath=PyramidRows,step=4,n_start=0 line_type=Y_axis
2503 # OEIS-Catalogue: A046092 planepath=PyramidRows,step=4,n_start=0 line_type=Diagonal
2504 # OEIS-Other: A001105 planepath=PyramidRows,step=4,n_start=0 line_type=Diagonal_NW
2505 },
2506 'step=4,align=right,n_start=0' =>
2507 { Y_axis => 'A000384', # 2*n^2-n, hexagonal numbers
2508 Diagonal => 'A001105',
2509 # OEIS-Other: A000384 planepath=PyramidRows,step=4,align=right,n_start=0 line_type=Y_axis
2510 # OEIS-Other: A001105 planepath=PyramidRows,step=4,align=right,n_start=0 line_type=Diagonal
2511 },
2512 'step=4,align=left,n_start=0' =>
2513 { Diagonal_NW => 'A046092', # 4*triangular
2514 # OEIS-Other: A046092 planepath=PyramidRows,step=4,align=left,n_start=0 line_type=Diagonal_NW
2515 },
2516  
2517 # TODO PyramidRows,step=5 n_start=0
2518  
2519 'step=5,align=centre,n_start=1' =>
2520 { Y_axis => 'A116668',
2521 # OEIS-Other: A116668 planepath=PyramidRows,step=5 line_type=Y_axis
2522 },
2523 'step=6,align=centre,n_start=1' =>
2524 { Diagonal_NW => 'A056107',
2525 Y_axis => 'A056108',
2526 Diagonal => 'A056109',
2527 # OEIS-Other: A056107 planepath=PyramidRows,step=6 line_type=Diagonal_NW
2528 # OEIS-Other: A056108 planepath=PyramidRows,step=6 line_type=Y_axis
2529 # OEIS-Other: A056109 planepath=PyramidRows,step=6 line_type=Diagonal
2530 },
2531 'step=8,align=centre,n_start=1' =>
2532 { Diagonal_NW => 'A053755',
2533 # OEIS-Other: A053755 planepath=PyramidRows,step=8 line_type=Diagonal_NW
2534 },
2535 'step=9,align=centre,n_start=1' =>
2536 { Y_axis => 'A006137',
2537 Diagonal => 'A038764',
2538 # OEIS-Other: A006137 planepath=PyramidRows,step=9 line_type=Y_axis
2539 # OEIS-Other: A038764 planepath=PyramidRows,step=9 line_type=Diagonal
2540 },
2541 };
2542 }
2543 { package Math::PlanePath::PyramidSides;
2544 use constant _NumSeq_X_axis_increasing => 1;
2545 use constant _NumSeq_Y_axis_increasing => 1;
2546 use constant _NumSeq_X_neg_increasing => 1;
2547 use constant _NumSeq_Diagonal_increasing => 1;
2548 use constant _NumSeq_Diagonal_NW_increasing => 1;
2549  
2550 use constant _NumSeq_N_oeis_anum =>
2551 { 'n_start=1' =>
2552 { X_neg => 'A002522',
2553 Diagonal => 'A033951',
2554 # OEIS-Catalogue: A002522 planepath=PyramidSides line_type=X_neg
2555 # OEIS-Other: A033951 planepath=PyramidSides line_type=Diagonal
2556 #
2557 # X_axis -- squares (x+1)^2, but starting i=0 value=1
2558 } };
2559 }
2560 { package Math::PlanePath::CellularRule;
2561 use constant _NumSeq_Y_axis_increasing => 1;
2562 use constant _NumSeq_Diagonal_increasing => 1;
2563 use constant _NumSeq_Diagonal_NW_increasing => 1;
2564  
2565 use constant _NumSeq_N_oeis_anum =>
2566 { 'rule=5,n_start=1' =>
2567 { Y_axis => 'A061925', # ceil(n^2/2)+1
2568 # OEIS-Catalogue: A061925 planepath=CellularRule,rule=5 line_type=Y_axis
2569 },
2570  
2571 # rule 84,116,212,244 two-wide right line
2572 do {
2573 my $tworight
2574 = { Diagonal => 'A005408', # odds 2n+1
2575 };
2576 ('rule=84,n_start=1' => $tworight,
2577 'rule=116,n_start=1' => $tworight,
2578 'rule=212,n_start=1' => $tworight,
2579 'rule=244,n_start=1' => $tworight,
2580 );
2581  
2582 # OEIS-Other: A005408 planepath=CellularRule,rule=84 line_type=Diagonal
2583 # OEIS-Other: A005408 planepath=CellularRule,rule=116 line_type=Diagonal
2584 # OEIS-Other: A005408 planepath=CellularRule,rule=212 line_type=Diagonal
2585 # OEIS-Other: A005408 planepath=CellularRule,rule=244 line_type=Diagonal
2586 },
2587 'rule=77,n_start=1' =>
2588 { Y_axis => 'A000124', # triangular+1
2589 # OEIS-Other: A000124 planepath=CellularRule,rule=77 line_type=Y_axis
2590 },
2591 'rule=177,n_start=1' =>
2592 { Diagonal => 'A000124', # triangular+1
2593 # OEIS-Other: A000124 planepath=CellularRule,rule=177 line_type=Diagonal
2594 },
2595 'rule=185,n_start=1' =>
2596 { Diagonal => 'A002522', # n^2+1
2597 # OEIS-Other: A002522 planepath=CellularRule,rule=185 line_type=Diagonal
2598 },
2599 'rule=189,n_start=1' =>
2600 { Y_axis => 'A002522', # n^2+1
2601 # OEIS-Other: A002522 planepath=CellularRule,rule=189 line_type=Y_axis
2602 },
2603 # PyramidRows step=1,align=left
2604 # OEIS-Other: A000124 planepath=CellularRule,rule=206 line_type=Diagonal_NW
2605 # OEIS-Other: A000124 planepath=CellularRule,rule=238 line_type=Diagonal_NW
2606  
2607 do {
2608 my $solidgapright
2609 = { Diagonal => 'A002522', # n^2+1
2610 };
2611 ('rule=209,n_start=1' => $solidgapright,
2612 'rule=241,n_start=1' => $solidgapright,
2613 );
2614 # OEIS-Other: A002522 planepath=CellularRule,rule=209 line_type=Diagonal
2615 # OEIS-Other: A002522 planepath=CellularRule,rule=241 line_type=Diagonal
2616 },
2617 'rule=29,n_start=1' =>
2618 { Y_axis => 'A000124', # triangular+1
2619 # OEIS-Other: A000124 planepath=CellularRule,rule=29 line_type=Y_axis
2620 },
2621 'rule=221,n_start=1' =>
2622 { Y_axis => 'A002522', # n^2+1
2623 # OEIS-Other: A002522 planepath=CellularRule,rule=221 line_type=Y_axis
2624 },
2625 'rule=229,n_start=1' =>
2626 { Y_axis => 'A002522', # n^2+1
2627 # OEIS-Other: A002522 planepath=CellularRule,rule=229 line_type=Y_axis
2628 },
2629 #
2630 # rule=13 Y axis
2631 #
2632 # rule=28,156
2633 # Y_axis => 'A002620', quarter squares floor(n^2/4) but diff start
2634 # Diagonal => 'A024206', quarter squares - 1, but diff start
2635 #
2636 # A000027 naturals integers 1 upwards, but OFFSET=1 cf start Y=0 here
2637 # # central column only
2638 # 'rule=4' =>
2639 # { Y_axis => 'A000027', # 1 upwards
2640 # # OEIS-Other: A000027 planepath=CellularRule,rule=4 line_type=Y_axis
2641 # },
2642 #
2643 # # right line only rule=16,24,48,56,80,88,112,120,144,152,176,184,208,216,240,248
2644 # Not quite A000027 OFFSET=1 vs start X=Y=0 here
2645 # 'rule=16' =>
2646 # { Y_axis => 'A000027', # 1 upwards
2647 # # OEIS-Other: A000027 planepath=CellularRule,rule=16 line_type=Diagonal
2648 # },
2649 };
2650 }
2651 {
2652 package Math::PlanePath::CellularRule::Line;
2653 use constant _NumSeq_Y_axis_increasing => 1;
2654 use constant _NumSeq_Diagonal_increasing => 1;
2655 use constant _NumSeq_Diagonal_NW_increasing => 1;
2656 }
2657 {
2658 package Math::PlanePath::CellularRule::OneTwo;
2659 use constant _NumSeq_Y_axis_increasing => 1;
2660 use constant _NumSeq_Diagonal_increasing => 1;
2661 use constant _NumSeq_Diagonal_NW_increasing => 1;
2662  
2663 # use constant _NumSeq_N_oeis_anum =>
2664 # { 'align=left,n_start=1' =>
2665 # {
2666 # Not quite, OFFSET=1 cf coordinate X=0 here
2667 # Diagonal_NW => 'A001651', # not divisible by 3
2668 # },
2669  
2670 # { 'align=right,n_start=1' =>
2671 # Not quite, A032766 0 or 1 mod 3, but it starts OFFSET=0 value=0
2672 # whereas path start 1,3,4,etc without initial 0
2673 # Diagonal => 'A032766',
2674 #
2675 # };
2676 }
2677 {
2678 package Math::PlanePath::CellularRule::Two;
2679 use constant _NumSeq_Y_axis_increasing => 1;
2680 use constant _NumSeq_Diagonal_increasing => 1;
2681 use constant _NumSeq_Diagonal_NW_increasing => 1;
2682  
2683 use constant _NumSeq_N_oeis_anum =>
2684 { 'align=right,n_start=1' =>
2685 { Diagonal => 'A005408', # odd 2n+1
2686 # OEIS-Other: A005408 planepath=CellularRule,rule=84 line_type=Diagonal
2687 },
2688 };
2689 }
2690 {
2691 package Math::PlanePath::CellularRule::OddSolid;
2692 # rule=50,58,114,122,178,179,186,242,250 pyramid every second point
2693  
2694 use constant _NumSeq_Y_axis_increasing => 1;
2695 use constant _NumSeq_Diagonal_increasing => 1;
2696 use constant _NumSeq_Diagonal_NW_increasing => 1;
2697  
2698 use constant _NumSeq_N_oeis_anum =>
2699 { 'n_start=1' =>
2700 { Diagonal_NW => 'A000124', # triangular+1
2701 # OEIS-Other: A000124 planepath=CellularRule,rule=50 line_type=Diagonal_NW
2702 # OEIS-Other: A000124 planepath=CellularRule,rule=58 line_type=Diagonal_NW
2703 # OEIS-Other: A000124 planepath=CellularRule,rule=114 line_type=Diagonal_NW
2704 # OEIS-Other: A000124 planepath=CellularRule,rule=122 line_type=Diagonal_NW
2705 # OEIS-Other: A000124 planepath=CellularRule,rule=178 line_type=Diagonal_NW
2706 # OEIS-Other: A000124 planepath=CellularRule,rule=179 line_type=Diagonal_NW
2707 # OEIS-Other: A000124 planepath=CellularRule,rule=186 line_type=Diagonal_NW
2708 # OEIS-Other: A000124 planepath=CellularRule,rule=242 line_type=Diagonal_NW
2709 # OEIS-Other: A000124 planepath=CellularRule,rule=250 line_type=Diagonal_NW
2710 #
2711 # Not quite, starts value=0
2712 # Diagonal => 'A000217', # triangular numbers but diff start
2713 },
2714 };
2715 }
2716 { package Math::PlanePath::CellularRule54;
2717 use constant _NumSeq_Y_axis_increasing => 1;
2718 use constant _NumSeq_Diagonal_increasing => 1;
2719 use constant _NumSeq_Diagonal_NW_increasing => 1;
2720 }
2721 { package Math::PlanePath::CellularRule57;
2722 use constant _NumSeq_Y_axis_increasing => 1;
2723 use constant _NumSeq_Diagonal_increasing => 1;
2724 use constant _NumSeq_Diagonal_NW_increasing => 1;
2725 }
2726 { package Math::PlanePath::CellularRule190;
2727 use constant _NumSeq_Y_axis_increasing => 1;
2728 use constant _NumSeq_Diagonal_increasing => 1;
2729 use constant _NumSeq_Diagonal_NW_increasing => 1;
2730  
2731 use constant _NumSeq_N_oeis_anum =>
2732 { 'mirror=0,n_start=0' =>
2733 { Diagonal_NW => 'A006578', # triangular and quarter square
2734 # OEIS-Catalogue: A006578 planepath=CellularRule190,n_start=0 line_type=Diagonal_NW
2735 },
2736 'mirror=1,n_start=0' =>
2737 { Diagonal_NW => 'A006578', # triangular and quarter square
2738 # OEIS-Other: A006578 planepath=CellularRule190,mirror=1,n_start=0 line_type=Diagonal_NW
2739 },
2740 };
2741 }
2742 { package Math::PlanePath::UlamWarburton;
2743 use constant _NumSeq_X_axis_increasing => 1;
2744 use constant _NumSeq_Y_axis_increasing => 1;
2745 use constant _NumSeq_X_neg_increasing => 1;
2746 use constant _NumSeq_Y_neg_increasing => 1;
2747 use constant _NumSeq_Diagonal_increasing => 1;
2748 use constant _NumSeq_Diagonal_NW_increasing => 1;
2749 use constant _NumSeq_Diagonal_SW_increasing => 1;
2750 use constant _NumSeq_Diagonal_SE_increasing => 1;
2751  
2752 use constant _NumSeq_N_oeis_anum =>
2753 { 'parts=4,n_start=0' =>
2754 { Depth_start => 'A147562', # cells ON after n stages
2755 # OEIS-Catalogue: A147562 planepath=UlamWarburton,n_start=0 line_type=Depth_start
2756 },
2757 'parts=2,n_start=0' =>
2758 { Depth_start => 'A183060', # num cells ON, starting from 0
2759 X_axis => 'A183060', # X_axis == Depth_start
2760 # OEIS-Catalogue: A183060 planepath=UlamWarburton,parts=2,n_start=0 line_type=Depth_start
2761 # OEIS-Other: A183060 planepath=UlamWarburton,parts=2,n_start=0
2762 },
2763 'parts=1,n_start=1' =>
2764 { Depth_end => 'A151922', # num cells ON at end of depth=n
2765 Y_axis => 'A151922', # Y_axis == Depth_end
2766 # OEIS-Catalogue: A151922 planepath=UlamWarburton,parts=1,n_start=1 line_type=Depth_end
2767 # OEIS-Other: A151922 planepath=UlamWarburton,parts=1,n_start=1 line_type=Y_axis
2768 },
2769 };
2770 }
2771 { package Math::PlanePath::UlamWarburtonQuarter;
2772 use constant _NumSeq_X_axis_increasing => 1;
2773 use constant _NumSeq_Diagonal_increasing => 1;
2774  
2775 # low 10111=23 increment to 11000=24
2776 # 4^2*3+4*3^2+1*3^3 = 111 123
2777 # 4^3*3 = 192 150 +27 = 3^3
2778  
2779 use constant _NumSeq_N_oeis_anum =>
2780 { 'parts=1,n_start=1' =>
2781 { Depth_end => 'A151920', # 3^count1bits(n), OFFSET=0 1,2,5,6,9
2782 # OEIS-Catalogue: A151920 planepath=UlamWarburtonQuarter line_type=Depth_end
2783 },
2784 };
2785 }
2786 { package Math::PlanePath::CoprimeColumns;
2787 use constant _NumSeq_X_axis_increasing => 1;
2788 use constant _NumSeq_Diagonal_increasing => 1;
2789 use constant _NumSeq_Diagonal_X_offset => 1;
2790  
2791 # CoprimeColumns
2792 # X_axis => 'A002088', # cumulative totient but start X=1 value=0;
2793 # Diagonal A015614 cumulative-1 but start X=1 value=1
2794 }
2795 { package Math::PlanePath::DivisibleColumns;
2796 use constant _NumSeq_X_axis_increasing => 1;
2797 use constant _NumSeq_Diagonal_increasing => 1;
2798  
2799 # Not quite, X_axis => 'A006218' but path start X=1 cf OFFSET=0,
2800 # Not quite, Diagonal => 'A077597' but path start X=1 cf OFFSET=0
2801 }
2802 # { package Math::PlanePath::File;
2803 # # File points from a disk file
2804 # # FIXME: analyze points for min/max
2805 # }
2806 # { package Math::PlanePath::QuintetCurve;
2807 # }
2808 # { package Math::PlanePath::QuintetCentres;
2809 # # inherit QuintetCurve
2810 # }
2811 { package Math::PlanePath::CornerReplicate;
2812 use constant _NumSeq_X_axis_increasing => 1;
2813 use constant _NumSeq_Y_axis_increasing => 1;
2814 use constant _NumSeq_Diagonal_increasing => 1;
2815  
2816 use constant _NumSeq_N_oeis_anum =>
2817 { '' =>
2818 { X_axis => 'A000695', # base 4 digits 0,1 only
2819 Y_axis => 'A001196', # base 4 digits 0,3 only
2820 Diagonal => 'A062880', # base 4 digits 0,2 only
2821 # OEIS-Other: A000695 planepath=CornerReplicate
2822 # OEIS-Other: A001196 planepath=CornerReplicate line_type=Y_axis
2823 # OEIS-Other: A062880 planepath=CornerReplicate line_type=Diagonal
2824 },
2825 };
2826 }
2827 { package Math::PlanePath::DigitGroups;
2828 use constant _NumSeq_Diagonal_increasing => 1;
2829  
2830 use constant _NumSeq_N_oeis_anum =>
2831 { 'radix=2,i_start=1' =>
2832 { X_axis => 'A084471', # 0 -> 00 in binary, starting OFFSET=1
2833 # OEIS-Catalogue: A084471 planepath=DigitGroups,radix=2 i_start=1
2834 },
2835 };
2836 }
2837 { package Math::PlanePath::FibonacciWordFractal;
2838 use constant _NumSeq_X_axis_increasing => 1; # when touched
2839 use constant _NumSeq_Y_axis_increasing => 1; # when touched
2840 use constant _NumSeq_Diagonal_increasing => 1; # when touched
2841 }
2842 { package Math::PlanePath::LTiling;
2843 use constant _NumSeq_Diagonal_increasing => 1;
2844  
2845 use constant _NumSeq_N_oeis_anum =>
2846 { 'L_fill=middle' =>
2847 { Diagonal => 'A062880', # base 4 digits 0,2 only
2848 # OEIS-Other: A062880 planepath=LTiling line_type=Diagonal
2849 },
2850 };
2851 }
2852 { package Math::PlanePath::WythoffArray;
2853 use constant _NumSeq_X_axis_increasing => 1;
2854 use constant _NumSeq_Y_axis_increasing => 1;
2855 use constant _NumSeq_Diagonal_increasing => 1;
2856  
2857 use constant _NumSeq_N_oeis_anum =>
2858 {
2859 'x_start=1,y_start=1' =>
2860 { Y_axis => 'A003622', # spectrum of phi 1,4,6,9
2861 Diagonal => 'A020941', # diagonal, OFFSET=1
2862 # OEIS-Catalogue: A003622 planepath=WythoffArray,x_start=1,y_start=1 line_type=Y_axis
2863 # OEIS-Catalogue: A020941 planepath=WythoffArray,x_start=1,y_start=1 line_type=Diagonal
2864  
2865 # Y=1 every second => 'A005248', # every second Lucas number
2866 },
2867  
2868 # # Not quite, extra initial 0,1 in A000045 Fibonaccis
2869 # # X_axis => 'A000045',
2870 #
2871 # # Y=1 row X=0,2,4,etc => 'A005248', # every second Lucas number
2872 };
2873 }
2874 { package Math::PlanePath::WythoffPreliminaryTriangle;
2875 use constant _NumSeq_Y_axis_i_start => 1;
2876 use constant _NumSeq_Y_axis_increasing => 1;
2877 use constant _NumSeq_N_oeis_anum =>
2878 {
2879 '' =>
2880 { Y_axis => 'A173027',
2881 # OEIS-Other: A173027 planepath=WythoffPreliminaryTriangle line_type=Y_axis
2882 },
2883 };
2884 }
2885 { package Math::PlanePath::PowerArray;
2886 use constant _NumSeq_X_axis_increasing => 1;
2887 use constant _NumSeq_Y_axis_increasing => 1;
2888 use constant _NumSeq_Diagonal_increasing => 1;
2889  
2890 # cf Not quite A168183 non-multiples-of-9, A168186 non-multiples-of-12
2891 # are values on Y axis, except OFFSET=1 value=1, whereas path start Y=0
2892 # value=1
2893 use constant _NumSeq_N_oeis_anum =>
2894 { 'radix=2' =>
2895 { X_axis => 'A000079', # powers 2^X
2896 Y_axis => 'A005408', # odd 2n+1
2897 Diagonal => 'A014480', # (2n+1)*2^n starting n=0
2898 # OEIS-Other: A000079 planepath=PowerArray
2899 # OEIS-Other: A005408 planepath=PowerArray line_type=Y_axis
2900 # OEIS-Catalogue: A014480 planepath=PowerArray line_type=Diagonal
2901 },
2902 'radix=3' =>
2903 { X_axis => 'A000244', # powers 3^X
2904 # OEIS-Other: A000244 planepath=PowerArray,radix=3
2905 #
2906 # Not quite, OFFSET=1 cf path start Y=0
2907 # Y_axis => 'A001651', # non multiples of 3
2908 },
2909 'radix=4' =>
2910 { X_axis => 'A000302', # powers 4^X
2911 # OEIS-Other: A000302 planepath=PowerArray,radix=4
2912 },
2913 'radix=5' =>
2914 { X_axis => 'A000351', # powers 5^X
2915 # OEIS-Other: A000351 planepath=PowerArray,radix=5
2916 },
2917 'radix=10' =>
2918 { X_axis => 'A011557', # powers 10^X
2919 # OEIS-Other: A011557 planepath=PowerArray,radix=10
2920  
2921 # Not quite, A067251 OFFSET=1 value=1 whereas path Y=0 N=value=1
2922 # Y_axis => 'A067251', # no trailing 0 digits
2923 # # OEIS-Catalogue: A067251 planepath=PowerArray,radix=10 line_type=Y_axis
2924 },
2925 };
2926 }
2927  
2928 #------------------------------------------------------------------------------
2929 # Math-PlanePath-Toothpick
2930  
2931 { package Math::PlanePath::ToothpickTree;
2932  
2933 # X axis has N=0 or N=0,1 only, except for parts=octant axis at Y=1
2934 sub _NumSeq_X_axis_increasing {
2935 my ($self) = @_;
2936 return ($self->{'parts'} ne 'octant');
2937 }
2938  
2939 # Y axis has N=0,N=1 only, except for parts=octant_up axis at X=1
2940 sub _NumSeq_Y_axis_increasing {
2941 my ($self) = @_;
2942 return ($self->{'parts'} ne 'octant_up');
2943 }
2944 use constant _NumSeq_Y_neg_increasing => 1; # N=0,N=2 only
2945  
2946 use constant _NumSeq_Diagonal_increasing => 1; # growth steps along diags
2947 use constant _NumSeq_Diagonal_NW_increasing => 1;
2948 use constant _NumSeq_Diagonal_SE_increasing => 1;
2949 use constant _NumSeq_Diagonal_SW_increasing => 1;
2950  
2951 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
2952 use constant _NumSeq_N_oeis_anum =>
2953 { 'parts=4' =>
2954 { Depth_start => 'A139250',
2955 # OEIS-Other: A139250 planepath=ToothpickTree,parts=4 line_type=Depth_start
2956 },
2957 'parts=3' =>
2958 { Depth_start => 'A153006',
2959 # OEIS-Other: A153006 planepath=ToothpickTree,parts=3 line_type=Depth_start
2960 },
2961 'parts=2' =>
2962 { Depth_start => 'A152998',
2963 # OEIS-Other: A152998 planepath=ToothpickTree,parts=2 line_type=Depth_start
2964 },
2965 'parts=1' =>
2966 { Depth_start => 'A153000',
2967 # OEIS-Other: A153000 planepath=ToothpickTree,parts=1 line_type=Depth_start
2968 },
2969 'parts=wedge' =>
2970 { Depth_start => 'A160406',
2971 # OEIS-Other: A160406 planepath=ToothpickTree,parts=wedge line_type=Depth_start
2972 },
2973 'parts=two_horiz' =>
2974 { Depth_start => 'A160158',
2975 # OEIS-Other: A160158 planepath=ToothpickTree,parts=two_horiz line_type=Depth_start
2976 },
2977 };
2978 }
2979 { package Math::PlanePath::ToothpickReplicate;
2980 use constant _NumSeq_Y_axis_increasing => 1; # N=0,N=1 only
2981  
2982 sub _NumSeq_Y_neg_increasing {
2983 my ($self) = @_;
2984 return ($self->{'parts'} == 3 ? 0 # replication twist
2985 : 1); # N=0,N=2 only
2986 }
2987 use constant _NumSeq_Diagonal_increasing => 1; # replicate along diags
2988 use constant _NumSeq_Diagonal_NW_increasing => 1;
2989 use constant _NumSeq_Diagonal_SE_increasing => 1;
2990 use constant _NumSeq_Diagonal_SW_increasing => 1;
2991 }
2992 { package Math::PlanePath::ToothpickUpist;
2993 use constant _NumSeq_Y_axis_increasing => 1; # rows increasing
2994 use constant _NumSeq_Diagonal_increasing => 1;
2995 use constant _NumSeq_Diagonal_NW_increasing => 1;
2996  
2997 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
2998 use constant _NumSeq_N_oeis_anum =>
2999 { '' =>
3000 { Depth_start => 'A151566',
3001 # OEIS-Other: A151566 planepath=ToothpickUpist line_type=Depth_start
3002 },
3003 };
3004 }
3005 { package Math::PlanePath::ToothpickSpiral;
3006 use constant _NumSeq_X_axis_increasing => 1;
3007 use constant _NumSeq_Y_axis_increasing => 1;
3008 use constant _NumSeq_X_neg_increasing => 1;
3009 use constant _NumSeq_Diagonal_increasing => 1;
3010 use constant _NumSeq_Diagonal_NW_increasing => 1;
3011 use constant _NumSeq_Diagonal_SW_increasing => 1;
3012 use constant _NumSeq_Diagonal_SE_increasing => 1;
3013  
3014 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
3015 use constant _NumSeq_N_oeis_anum =>
3016 { 'n_start=1' =>
3017 { Diagonal => 'A014634', # odd-index hexagonals
3018 Diagonal_NW => 'A033567', #
3019 Diagonal_SW => 'A185438', #
3020 Diagonal_SE => 'A188135', #
3021 # OEIS-Other: A014634 planepath=ToothpickSpiral line_type=Diagonal
3022 # OEIS-Other: A033567 planepath=ToothpickSpiral line_type=Diagonal_NW
3023 # OEIS-Other: A185438 planepath=ToothpickSpiral line_type=Diagonal_SW
3024 # OEIS-Other: A188135 planepath=ToothpickSpiral line_type=Diagonal_SE
3025 },
3026 'n_start=0' =>
3027 { Diagonal => 'A033587', #
3028 Diagonal_SW => 'A014635', # even-index hexagonals
3029 Diagonal_SE => 'A033585', #
3030 Diagonal_NW => 'A139271',
3031 # OEIS-Other: A033587 planepath=ToothpickSpiral,n_start=0 line_type=Diagonal
3032 # OEIS-Other: A014635 planepath=ToothpickSpiral,n_start=0 line_type=Diagonal_SW
3033 # OEIS-Other: A033585 planepath=ToothpickSpiral,n_start=0 line_type=Diagonal_SE
3034 # OEIS-Other: A139271 planepath=ToothpickSpiral,n_start=0 line_type=Diagonal_NW
3035 },
3036 };
3037 }
3038  
3039 { package Math::PlanePath::LCornerTree;
3040 sub _NumSeq_X_axis_increasing {
3041 my ($self) = @_;
3042 return $self->{'parts'} ne 'diagonal-1';
3043 }
3044  
3045 {
3046 my %_NumSeq_Y_axis_increasing = ('octant+1' => 1, # two points only
3047 'diagonal-1' => 1,
3048 );
3049 sub _NumSeq_Y_axis_increasing {
3050 my ($self) = @_;
3051 return $_NumSeq_Y_axis_increasing{$self->{'parts'}};
3052 }
3053 }
3054  
3055 sub _NumSeq_X_neg_increasing {
3056 my ($self) = @_;
3057 return ($self->{'parts'} eq 'wedge' # two points N=0,N=1
3058 || $self->{'parts'} eq 'wedge+1' # three points N=0,1,7
3059 || $self->{'parts'} eq 'diagonal');
3060 }
3061  
3062 # parts=diagonal has minimum N=0 at X=0,Y=-1, so explicit Y_neg minimum
3063 use constant _NumSeq_Y_neg_min => 0;
3064 sub _NumSeq_Y_neg_increasing {
3065 my ($self) = @_;
3066 return $self->{'parts'} ne 'diagonal';
3067 }
3068 use constant _NumSeq_Diagonal_increasing => 1; # growth along diags
3069 use constant _NumSeq_Diagonal_NW_increasing => 1;
3070 use constant _NumSeq_Diagonal_SE_increasing => 1;
3071 use constant _NumSeq_Diagonal_SW_increasing => 1;
3072  
3073 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
3074 use constant _NumSeq_N_oeis_anum =>
3075 { 'parts=4' =>
3076 { Depth_start => 'A160410', # 4 * cumulative 3^count1bits(n)
3077 # OEIS-Other: A160410 planepath=LCornerTree line_type=Depth_start
3078 },
3079 'parts=3' =>
3080 { Depth_start => 'A160412', # 3 * cumulative 3^count1bits(n)
3081 # OEIS-Other: A160412 planepath=LCornerTree,parts=3 line_type=Depth_start
3082 },
3083 'parts=diagonal-1' =>
3084 { Depth_start => 'A183148', # half-plane triplet toothpicks
3085 # OEIS-Other: A183148 planepath=LCornerTree,parts=diagonal-1 line_type=Depth_start
3086  
3087 # No, N=1 start of depth=1 is at X=1,Y=0 not on SE diagonal
3088 # Diagonal_SE => 'A183148',
3089 },
3090  
3091 # Not quite, A130665=1,4,7,16 offset=0 whereas Nend=0,1,4,7,16 depth=0
3092 # has extra initial 0.
3093 # 'parts=1' =>
3094 # { Depth_end => 'A130665', # cumulative 3^count1bits(d), starting a(0)=1
3095 # # OEIS-Catalogue: A130665 planepath=LCornerTree,parts=1,n_start=-1 line_type=Depth_end i_offset=1
3096 # },
3097 };
3098 }
3099 { package Math::PlanePath::LCornerReplicate;
3100 use constant _NumSeq_X_axis_increasing => 1;
3101 use constant _NumSeq_Diagonal_increasing => 1; # replicate along diags
3102  
3103 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
3104 use constant _NumSeq_N_oeis_anum =>
3105 { '' =>
3106 { Diagonal => 'A062880', # base 4 digits 0,2 only
3107 # OEIS-Other: A062880 planepath=LCornerReplicate line_type=Diagonal
3108 },
3109 };
3110 }
3111  
3112 { package Math::PlanePath::OneOfEight;
3113 use constant _NumSeq_X_axis_increasing => 1;
3114 use constant _NumSeq_X_neg_increasing => 1;
3115 use constant _NumSeq_Y_axis_increasing => 1;
3116 use constant _NumSeq_Y_neg_increasing => 1;
3117 use constant _NumSeq_Diagonal_increasing => 1;
3118 use constant _NumSeq_Diagonal_NW_increasing => 1;
3119 use constant _NumSeq_Diagonal_SW_increasing => 1;
3120 use constant _NumSeq_Diagonal_SE_increasing => 1;
3121  
3122 # catalogued in Math::NumSeq::OEIS::Catalogue::Plugin::PlanePathToothpick
3123 use constant _NumSeq_N_oeis_anum =>
3124 { 'parts=4' =>
3125 { Depth_start => 'A151725',
3126 # OEIS-Other: A151725 planepath=OneOfEight line_type=Depth_start
3127 },
3128 'parts=1' =>
3129 { Depth_start => 'A151735',
3130 # OEIS-Other: A151735 planepath=OneOfEight,parts=1 line_type=Depth_start
3131 },
3132 'parts=3mid' =>
3133 { Depth_start => 'A170880',
3134 # OEIS-Other: A170880 planepath=OneOfEight,parts=3mid line_type=Depth_start
3135 },
3136 'parts=3side' =>
3137 { Depth_start => 'A170879',
3138 # OEIS-Other: A170879 planepath=OneOfEight,parts=3side line_type=Depth_start
3139 },
3140 };
3141 }
3142  
3143 { package Math::PlanePath::HTree;
3144 # clockwise around each sub-tree so N increases along X axis
3145 use constant _NumSeq_X_axis_increasing => 1;
3146 }
3147  
3148 #------------------------------------------------------------------------------
3149 { package Math::PlanePath;
3150 use constant _NumSeq_A2 => 0;
3151 }
3152 { package Math::PlanePath::TriangleSpiral;
3153 use constant _NumSeq_A2 => 1;
3154 }
3155 { package Math::PlanePath::HexSpiral;
3156 use constant _NumSeq_A2 => 1;
3157 }
3158 { package Math::PlanePath::HexArms;
3159 use constant _NumSeq_A2 => 1;
3160 }
3161 { package Math::PlanePath::TriangularHypot;
3162 use constant _NumSeq_A2 => 1;
3163 }
3164 { package Math::PlanePath::Flowsnake;
3165 use constant _NumSeq_A2 => 1;
3166 # and FlowsnakeCentres inherits
3167 }
3168  
3169 1;
3170 __END__