@@ -50,6 +50,25 @@ describe("Plane Figurate Numbers Generation", () => {
5050 ) ;
5151 } ) ;
5252
53+ it ( "should return the sequence of polygram numbers" , ( ) => {
54+ compareExpectToEqual (
55+ PlaneFigNumbers . generate ( "polygram" , { m : 3n } ) ,
56+ [
57+ 1 , 7 , 19 , 37 , 61 , 91 , 127 , 169 , 217 , 271 , 331 , 397 , 469 , 547 , 631 , 721 , 817 , 919 , 1027 ,
58+ 1141 , 1261 , 1387 , 1519 , 1657 , 1801 , 1951 , 2107 , 2269 , 2437 , 2611 , 2791 , 2977 , 3169 , 3367 ,
59+ 3571 , 3781 , 3997 , 4219 , 4447 , 4681 , 4921 , 5167 , 5419 , 5677 , 5941 , 6211 , 6487 , 6769 , 7057 ,
60+ 7351 ,
61+ ] ,
62+ ) ;
63+ } ) ;
64+
65+ it ( "should return the sequence of pentagram numbers" , ( ) => {
66+ compareExpectToEqual (
67+ PlaneFigNumbers . generate ( "pentagram" , { } ) ,
68+ [ 1 , 11 , 31 , 61 , 101 , 151 , 211 , 281 , 361 , 451 ] ,
69+ ) ;
70+ } ) ;
71+
5372 it ( "should return the sequence of cross numbers" , ( ) => {
5473 compareExpectToEqual (
5574 PlaneFigNumbers . generate ( "cross" , { } ) ,
@@ -60,4 +79,62 @@ describe("Plane Figurate Numbers Generation", () => {
6079 ] ,
6180 ) ;
6281 } ) ;
82+
83+ it ( "should return the sequence of polite numbers" , ( ) => {
84+ compareExpectToEqual (
85+ PlaneFigNumbers . generate ( "polite" , { } ) ,
86+ [ 1 , 3 , 5 , 6 , 7 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 17 , 18 , 19 ] ,
87+ ) ;
88+ } ) ;
89+
90+ it ( "should return the sequence of impolite numbers" , ( ) => {
91+ compareExpectToEqual (
92+ PlaneFigNumbers . generate ( "impolite" , { } ) ,
93+ [ 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 , 512 , 1024 , 2048 , 4096 , 8192 , 16384 ] ,
94+ ) ;
95+ } ) ;
96+
97+ it ( "should return the sequence of aztec diamond numbers" , ( ) => {
98+ compareExpectToEqual (
99+ PlaneFigNumbers . generate ( "aztecDiamond" , { } ) ,
100+ [ 4 , 12 , 24 , 40 , 60 , 84 , 112 , 144 , 180 , 220 ] ,
101+ ) ;
102+ } ) ;
103+
104+ it ( "should return the sequence of gnomic numbers" , ( ) => {
105+ compareExpectToEqual (
106+ PlaneFigNumbers . generate ( "gnomic" , { } ) ,
107+ [ 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 ] ,
108+ ) ;
109+ } ) ;
110+
111+ it ( "should return the sequence of pronic numbers" , ( ) => {
112+ compareExpectToEqual (
113+ PlaneFigNumbers . generate ( "pronic" , { } ) ,
114+ [
115+ 2 , 6 , 12 , 20 , 30 , 42 , 56 , 72 , 90 , 110 , 132 , 156 , 182 , 210 , 240 , 272 , 306 , 342 , 380 , 420 ,
116+ 462 , 506 , 552 , 600 , 650 , 702 , 756 , 812 , 870 , 930 , 992 , 1056 , 1122 , 1190 , 1260 , 1332 , 1406 ,
117+ 1482 , 1560 , 1640 , 1722 , 1806 , 1892 , 1980 , 2070 , 2162 , 2256 , 2352 , 2450 , 2550 , 2652 , 2756 ,
118+ 2862 , 2970 , 3080 , 3192 , 3306 , 3422 , 3540 , 3660 , 3782 , 3906 , 4032 , 4160 , 4290 , 4422 , 4556 ,
119+ 4692 , 4830 , 4970 , 5112 , 5256 , 5402 , 5550 , 5700 , 5852 , 6006 , 6162 , 6320 , 6480 ,
120+ ] ,
121+ ) ;
122+ } ) ;
123+
124+ it ( "should return the sequence of truncated pronic numbers" , ( ) => {
125+ compareExpectToEqual (
126+ PlaneFigNumbers . generate ( "truncatedPronic" , { } ) ,
127+ [ 2 , 16 , 44 , 86 , 142 , 212 , 296 , 394 , 506 , 632 ] ,
128+ ) ;
129+ } ) ;
130+
131+ it ( "should return the sequence of truncated centered polygonal numbers" , ( ) => {
132+ compareExpectToEqual (
133+ PlaneFigNumbers . generate ( "truncatedCenteredPolygonal" , { m : 7n } ) ,
134+ [
135+ 1 , 36 , 120 , 253 , 435 , 666 , 946 , 1275 , 1653 , 2080 , 2556 , 3081 , 3655 , 4278 , 4950 , 5671 , 6441 ,
136+ 7260 , 8128 , 9045 , 10011 , 11026 , 12090 , 13203 , 14365 ,
137+ ] ,
138+ ) ;
139+ } ) ;
63140} ) ;
0 commit comments