figurate_numbers 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +28 -391
- data/docs/ERRATA.md +71 -0
- data/docs/METHODS.md +262 -0
- data/lib/figurate_numbers/multidimensional_figurate_numbers.rb +540 -551
- data/lib/figurate_numbers/p_adic_utils/p_adic_utils.rb +27 -0
- data/lib/figurate_numbers/plane_figurate_numbers.rb +420 -394
- data/lib/figurate_numbers/space_figurate_numbers.rb +417 -425
- data/lib/figurate_numbers/utils/utils.rb +29 -29
- data/lib/figurate_numbers/version.rb +3 -1
- data/lib/figurate_numbers.rb +4 -6
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f88663fb4b29da717f010c1f0316c6f43b84742bf90149c988f280af9642696
|
4
|
+
data.tar.gz: f96d3430868d3aa1e7fa9152586c90eb83cda937f6d2a3c87434cfdd4fe13241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725f757198c2c298a12331410c98bcf1a6c001675c9fc8f6244f0dec7023bba66f88a05eaaa2bae4e97edb9f08992ec168cf8fc660dafcd0ddd82ebbd37c9fa3
|
7
|
+
data.tar.gz: 62e57fdb8abf8546e6f5cca8c97eee63fbc9d9acba3f86299fed7619e75a97817c5de6dfdabea91927765f24557fa41df9c9797388969c2d9771177e7c914410
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1 align="center"> Figurate Numbers </h1>
|
2
2
|
|
3
|
-
**Figurate Numbers** is the most comprehensive and specialized
|
3
|
+
**Figurate Numbers** is the most comprehensive and specialized library for figurate numbers, developed in Ruby to date.
|
4
4
|
It implements **241 infinite number sequences** inspired by the groundbreaking work [*Figurate Numbers*](https://books.google.com.pe/books/about/Figurate_Numbers.html?id=ERS7CgAAQBAJ&redir_esc=y) by Elena Deza and Michel Deza, published in 2012.
|
5
5
|
|
6
6
|
<p align="center">
|
@@ -10,9 +10,10 @@ It implements **241 infinite number sequences** inspired by the groundbreaking w
|
|
10
10
|
<img src="https://img.shields.io/github/license/edelveart/figurate_numbers" alt="GitHub License">
|
11
11
|
</p>
|
12
12
|
|
13
|
-
](https://rubygems.org/gems/figurate_numbers)
|
14
14
|
|
15
|
-
|
15
|
+
|
16
|
+
## 💎 Installation
|
16
17
|
|
17
18
|
Install it from the gem repository:
|
18
19
|
|
@@ -20,21 +21,20 @@ Install it from the gem repository:
|
|
20
21
|
gem install figurate_numbers
|
21
22
|
```
|
22
23
|
|
23
|
-
## Features
|
24
|
+
## 🧊 Features
|
24
25
|
|
25
|
-
|
26
|
-
It is intended for use in mathematical projects and with Sonic Pi.
|
26
|
+
Figurate Numbers implements 241 infinite sequences using the Enumerator class in Ruby, each categorized by its geometric dimension. It is ideal for use in mathematical modeling, algorithmic composition, and integration with tools like Sonic Pi.
|
27
27
|
|
28
|
-
|
28
|
+
The sequences are organized following the structure of the *Figurate Numbers* book:
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
- 🟦 **PlaneFigurateNumbers** – 79 sequences (2D)
|
31
|
+
- 🟥 **SpaceFigurateNumbers** – 86 sequences (3D)
|
32
|
+
- 🟨 **MultiDimensionalFigurateNumbers** – 70 sequences (4D and beyond)
|
33
|
+
- 🧬 **Zoo of figurate-related numbers** – 6 additional sequences *(included in the MultiDimensional module)*
|
34
34
|
|
35
|
-
|
35
|
+
> 📚 Explore the detailed list of figurate numbers [here 🔍.](docs/METHODS.md)
|
36
36
|
|
37
|
-
## How to use in Ruby
|
37
|
+
## 🧰 How to use in Ruby
|
38
38
|
|
39
39
|
```rb
|
40
40
|
require 'figurate_numbers'
|
@@ -49,407 +49,44 @@ f.next
|
|
49
49
|
f.next
|
50
50
|
```
|
51
51
|
|
52
|
-
|
52
|
+
Starting with version **1.4.0**, you can also call methods directly from their respective classes. This allows you to work with figurate numbers grouped by their geometric dimension:
|
53
53
|
|
54
|
-
Since version **1.4.0**, you can alternatively call from the classes
|
55
54
|
```rb
|
56
55
|
PlaneFigurateNumbers.polygonal(3)
|
57
56
|
SpaceFigurateNumbers.rhombic_dodecahedral
|
58
57
|
MultiDimensionalFigurateNumbers.six_dimensional_hyperoctahedron
|
59
58
|
```
|
60
59
|
|
61
|
-
|
62
|
-
|
63
|
-
## How to use in Sonic Pi
|
60
|
+
## 🎶 How to use in Sonic Pi
|
64
61
|
|
65
|
-
###
|
62
|
+
### Version 1.4.0
|
66
63
|
|
67
64
|
Starting from version **1.4.0**, you can use the library globally through `FigurateNumbers`to access all sequences, or you can use the specific classes mentioned above for separate access.
|
68
65
|
The main change compared to version **1.3.0** is that you now need to import the file using **require** instead of **run_file**; otherwise, it will not function.
|
69
66
|
|
70
67
|
```rb
|
71
68
|
require "<PATH>"
|
72
|
-
|
73
|
-
|
74
|
-
Simply copy the entry point path from the `lib/figurate_numbers.rb` file where the *gem* is installed.
|
75
|
-
|
76
|
-
### figurate_numbers - Version 1.3.0
|
77
|
-
|
78
|
-
You can read and comment in the [**Sonic Pi community thread right here!**](https://in-thread.sonic-pi.net/t/figurate-numbers-for-sonic-pi-new-ruby-gem-for-infinite-number-sequences-and-patterns/8962)
|
79
|
-
|
80
|
-
1. Locate or download the file in the path `lib/figurate_numbers.rb`
|
81
|
-
2. Drag the file to a buffer in Sonic Pi (this generates the `<PATH>`)
|
82
|
-
|
83
|
-
```rb
|
84
|
-
run_file "<PATH>"
|
85
|
-
sleep 1 # see the quote below
|
86
|
-
pol_num = FigurateNumbers.polygonal_numbers(8)
|
87
|
-
80.times do
|
69
|
+
pol_num = FigurateNumbers.polygonal(8)
|
70
|
+
350.times do
|
88
71
|
play pol_num.next % 12 * 7 # Some mathematical function or transformation
|
89
|
-
sleep 0.
|
72
|
+
sleep 0.125
|
90
73
|
end
|
91
74
|
```
|
92
75
|
|
93
|
-
|
94
|
-
|
95
|
-
## List of implemented sequences
|
96
|
-
|
97
|
-
* Note that `=` means that you can call the same sequence with different names.
|
98
|
-
|
99
|
-
### 1. Plane Figurate Numbers
|
100
|
-
|
101
|
-
1. `polygonal(m)`
|
102
|
-
2. `triangular`
|
103
|
-
3. `square`
|
104
|
-
4. `pentagonal`
|
105
|
-
5. `hexagonal`
|
106
|
-
6. `heptagonal`
|
107
|
-
7. `octagonal`
|
108
|
-
8. `nonagonal`
|
109
|
-
9. `decagonal`
|
110
|
-
10. `hendecagonal`
|
111
|
-
11. `dodecagonal`
|
112
|
-
12. `tridecagonal`
|
113
|
-
13. `tetradecagonal`
|
114
|
-
14. `pentadecagonal`
|
115
|
-
15. `hexadecagonal`
|
116
|
-
16. `heptadecagonal`
|
117
|
-
17. `octadecagonal`
|
118
|
-
18. `nonadecagonal`
|
119
|
-
19. `icosagonal`
|
120
|
-
20. `icosihenagonal`
|
121
|
-
21. `icosidigonal`
|
122
|
-
22. `icositrigonal`
|
123
|
-
23. `icositetragonal`
|
124
|
-
24. `icosipentagonal`
|
125
|
-
25. `icosihexagonal`
|
126
|
-
26. `icosiheptagonal`
|
127
|
-
27. `icosioctagonal`
|
128
|
-
28. `icosinonagonal`
|
129
|
-
29. `triacontagonal`
|
130
|
-
30. `centered_triangular`
|
131
|
-
31. `centered_square` = `diamond` (equality only by quantity)
|
132
|
-
32. `centered_pentagonal`
|
133
|
-
33. `centered_hexagonal`
|
134
|
-
34. `centered_heptagonal`
|
135
|
-
35. `centered_octagonal`
|
136
|
-
36. `centered_nonagonal`
|
137
|
-
37. `centered_decagonal`
|
138
|
-
38. `centered_hendecagonal`
|
139
|
-
39. `centered_dodecagonal` = `star` (equality only by quantity)
|
140
|
-
40. `centered_tridecagonal`
|
141
|
-
41. `centered_tetradecagonal`
|
142
|
-
42. `centered_pentadecagonal`
|
143
|
-
43. `centered_hexadecagonal`
|
144
|
-
44. `centered_heptadecagonal`
|
145
|
-
45. `centered_octadecagonal`
|
146
|
-
46. `centered_nonadecagonal`
|
147
|
-
47. `centered_icosagonal`
|
148
|
-
48. `centered_icosihenagonal`
|
149
|
-
49. `centered_icosidigonal`
|
150
|
-
50. `centered_icositrigonal`
|
151
|
-
51. `centered_icositetragonal`
|
152
|
-
52. `centered_icosipentagonal`
|
153
|
-
53. `centered_icosihexagonal`
|
154
|
-
54. `centered_icosiheptagonal`
|
155
|
-
55. `centered_icosioctagonal`
|
156
|
-
56. `centered_icosinonagonal`
|
157
|
-
57. `centered_triacontagonal`
|
158
|
-
58. `centered_mgonal(m)`
|
159
|
-
59. `pronic` = `heteromecic` = `oblong`
|
160
|
-
60. `polite`
|
161
|
-
61. `impolite`
|
162
|
-
62. `cross`
|
163
|
-
63. `aztec_diamond`
|
164
|
-
64. `polygram(m)` = `centered_star_polygonal(m)`
|
165
|
-
65. `pentagram`
|
166
|
-
66. `gnomic`
|
167
|
-
67. `truncated_triangular`
|
168
|
-
68. `truncated_square`
|
169
|
-
69. `truncated_pronic`
|
170
|
-
70. `truncated_centered_pol(m)` = `truncated_centered_mgonal(m)`
|
171
|
-
71. `truncated_centered_triangular`
|
172
|
-
72. `truncated_centered_square`
|
173
|
-
73. `truncated_centered_pentagonal`
|
174
|
-
74. `truncated_centered_hexagonal` = `truncated_hex`
|
175
|
-
75. `generalized_mgonal(m, left_index = 0)`
|
176
|
-
76. `generalized_pentagonal(left_index = 0)`
|
177
|
-
77. `generalized_hexagonal(left_index = 0)`
|
178
|
-
78. `generalized_centered_pol(m, left_index = 0)`
|
179
|
-
79. `generalized_pronic(left_index = 0)`
|
180
|
-
|
181
|
-
### 2. Space Figurate Numbers
|
182
|
-
|
183
|
-
1. `r_pyramidal(r)`
|
184
|
-
2. `triangular_pyramidal = tetrahedral`
|
185
|
-
3. `square_pyramidal = pyramidal`
|
186
|
-
4. `pentagonal_pyramidal`
|
187
|
-
5. `hexagonal_pyramidal`
|
188
|
-
6. `heptagonal_pyramidal`
|
189
|
-
7. `octagonal_pyramidal`
|
190
|
-
8. `nonagonal_pyramidal`
|
191
|
-
9. `decagonal_pyramidal`
|
192
|
-
10. `hendecagonal_pyramidal`
|
193
|
-
11. `dodecagonal_pyramidal`
|
194
|
-
12. `tridecagonal_pyramidal`
|
195
|
-
13. `tetradecagonal_pyramidal`
|
196
|
-
14. `pentadecagonal_pyramidal`
|
197
|
-
15. `hexadecagonal_pyramidal`
|
198
|
-
16. `heptadecagonal_pyramidal`
|
199
|
-
17. `octadecagonal_pyramidal`
|
200
|
-
18. `nonadecagonal_pyramidal`
|
201
|
-
19. `icosagonal_pyramidal`
|
202
|
-
20. `icosihenagonal_pyramidal`
|
203
|
-
21. `icosidigonal_pyramidal`
|
204
|
-
22. `icositrigonal_pyramidal`
|
205
|
-
23. `icositetragonal_pyramidal`
|
206
|
-
24. `icosipentagonal_pyramidal`
|
207
|
-
25. `icosihexagonal_pyramidal`
|
208
|
-
26. `icosiheptagonal_pyramidal`
|
209
|
-
27. `icosioctagonal_pyramidal`
|
210
|
-
28. `icosinonagonal_pyramidal`
|
211
|
-
29. `triacontagonal_pyramidal`
|
212
|
-
30. `triangular_tetrahedral [finite]`
|
213
|
-
31. `triangular_square_pyramidal [finite]`
|
214
|
-
32. `square_tetrahedral [finite]`
|
215
|
-
33. `square_square_pyramidal [finite]`
|
216
|
-
34. `tetrahedral_square_pyramidal_number [finite]`
|
217
|
-
35. `cubic = perfect_cube != hex_pyramidal (equality only by quantity)`
|
218
|
-
36. `tetrahedral`
|
219
|
-
37. `octahedral`
|
220
|
-
38. `dodecahedral`
|
221
|
-
39. `icosahedral`
|
222
|
-
40. `truncated_tetrahedral`
|
223
|
-
41. `truncated_cubic`
|
224
|
-
42. `truncated_octahedral`
|
225
|
-
43. `stella_octangula`
|
226
|
-
44. `centered_cube`
|
227
|
-
45. `rhombic_dodecahedral`
|
228
|
-
46. `hauy_rhombic_dodecahedral`
|
229
|
-
47. `centered_tetrahedron = centered_tetrahedral`
|
230
|
-
48. `centered_square_pyramid = centered_pyramid`
|
231
|
-
49. `centered_mgonal_pyramid(m)`
|
232
|
-
50. `centered_pentagonal_pyramid != centered_octahedron (equality only in quantity)`
|
233
|
-
51. `centered_hexagonal_pyramid`
|
234
|
-
52. `centered_heptagonal_pyramid`
|
235
|
-
53. `centered_octagonal_pyramid`
|
236
|
-
54. `centered_octahedron`
|
237
|
-
55. `centered_icosahedron = centered_cuboctahedron`
|
238
|
-
56. `centered_dodecahedron`
|
239
|
-
57. `centered_truncated_tetrahedron`
|
240
|
-
58. `centered_truncated_cube`
|
241
|
-
59. `centered_truncated_octahedron`
|
242
|
-
60. `centered_mgonal_pyramidal(m)`
|
243
|
-
61. `centered_triangular_pyramidal`
|
244
|
-
62. `centered_square_pyramidal`
|
245
|
-
63. `centered_pentagonal_pyramidal`
|
246
|
-
64. `centered_hexagonal_pyramidal = hex_pyramidal`
|
247
|
-
65. `centered_heptagonal_pyramidal`
|
248
|
-
66. `centered_octagonal_pyramidal`
|
249
|
-
67. `centered_nonagonal_pyramidal`
|
250
|
-
68. `centered_decagonal_pyramidal`
|
251
|
-
69. `centered_hendecagonal_pyramidal`
|
252
|
-
70. `centered_dodecagonal_pyramidal`
|
253
|
-
71. `hexagonal_prism`
|
254
|
-
72. `mgonal_prism(m)`
|
255
|
-
73. `generalized_mgonal_pyramidal(m, left_index = 0)`
|
256
|
-
74. `generalized_pentagonal_pyramidal(left_index = 0)`
|
257
|
-
75. `generalized_hexagonal_pyramidal(left_index = 0)`
|
258
|
-
76. `generalized_cubic(left_index = 0)`
|
259
|
-
77. `generalized_octahedral(left_index = 0)`
|
260
|
-
78. `generalized_icosahedral(left_index = 0)`
|
261
|
-
79. `generalized_dodecahedral(left_index = 0)`
|
262
|
-
80. `generalized_centered_cube(left_index = 0)`
|
263
|
-
81. `generalized_centered_tetrahedron(left_index = 0)`
|
264
|
-
82. `generalized_centered_square_pyramid(left_index = 0)`
|
265
|
-
83. `generalized_rhombic_dodecahedral(left_index = 0)`
|
266
|
-
84. `generalized_centered_mgonal_pyramidal(m, left_index = 0)`
|
267
|
-
85. `generalized_mgonal_prism(m, left_index = 0)`
|
268
|
-
86. `generalized_hexagonal_prism(left_index = 0)`
|
269
|
-
|
270
|
-
### 3. Multidimensional figurate numbers
|
271
|
-
|
272
|
-
1. `pentatope = hypertetrahedral = triangulotriangular`
|
273
|
-
2. `k_dimensional_hypertetrahedron(k) = k_hypertetrahedron(k) = regular_k_polytopic(k) = figurate_numbers_of_order_k(k)`
|
274
|
-
3. `five_dimensional_hypertetrahedron`
|
275
|
-
4. `six_dimensional_hypertetrahedron`
|
276
|
-
5. `biquadratic`
|
277
|
-
6. `k_dimensional_hypercube(k) = k_hypercube(k)`
|
278
|
-
7. `five_dimensional_hypercube`
|
279
|
-
8. `six_dimensional_hypercube`
|
280
|
-
9. `hyperoctahedral = hexadecachoron = four_cross_polytope = four_orthoplex`
|
281
|
-
10. `hypericosahedral = tetraplex = polytetrahedron = hexacosichoron`
|
282
|
-
11. `hyperdodecahedral = hecatonicosachoron = dodecaplex = polydodecahedron`
|
283
|
-
12. `polyoctahedral = icositetrachoron = octaplex = hyperdiamond`
|
284
|
-
13. `four_dimensional_hyperoctahedron`
|
285
|
-
14. `five_dimensional_hyperoctahedron`
|
286
|
-
15. `six_dimensional_hyperoctahedron`
|
287
|
-
16. `seven_dimensional_hyperoctahedron`
|
288
|
-
17. `eight_dimensional_hyperoctahedron`
|
289
|
-
18. `nine_dimensional_hyperoctahedron`
|
290
|
-
19. `ten_dimensional_hyperoctahedron`
|
291
|
-
20. `k_dimensional_hyperoctahedron(k) = k_cross_polytope(k)`
|
292
|
-
21. `four_dimensional_mgonal_pyramidal(m) = mgonal_pyramidal_numbers_of_the_second_order(m)`
|
293
|
-
22. `four_dimensional_square_pyramidal`
|
294
|
-
23. `four_dimensional_pentagonal_pyramidal`
|
295
|
-
24. `four_dimensional_hexagonal_pyramidal`
|
296
|
-
25. `four_dimensional_heptagonal_pyramidal`
|
297
|
-
26. `four_dimensional_octagonal_pyramidal`
|
298
|
-
27. `four_dimensional_nonagonal_pyramidal`
|
299
|
-
28. `four_dimensional_decagonal_pyramidal`
|
300
|
-
29. `four_dimensional_hendecagonal_pyramidal`
|
301
|
-
30. `four_dimensional_dodecagonal_pyramidal`
|
302
|
-
31. `k_dimensional_mgonal_pyramidal(k, m) = mgonal_pyramidal_of_the_k_2_th_order(k, m)`
|
303
|
-
32. `five_dimensional_mgonal_pyramidal(m)`
|
304
|
-
33. `five_dimensional_square_pyramidal`
|
305
|
-
34. `five_dimensional_pentagonal_pyramidal`
|
306
|
-
35. `five_dimensional_hexagonal_pyramidal`
|
307
|
-
36. `five_dimensional_heptagonal_pyramidal`
|
308
|
-
37. `five_dimensional_octagonal_pyramidal`
|
309
|
-
38. `six_dimensional_mgonal_pyramidal(m)`
|
310
|
-
39. `six_dimensional_square_pyramidal`
|
311
|
-
40. `six_dimensional_pentagonal_pyramidal`
|
312
|
-
41. `six_dimensional_hexagonal_pyramidal`
|
313
|
-
42. `six_dimensional_heptagonal_pyramidal`
|
314
|
-
43. `six_dimensional_octagonal_pyramidal`
|
315
|
-
44. `centered_biquadratic`
|
316
|
-
45. `k_dimensional_centered_hypercube(k)`
|
317
|
-
46. `five_dimensional_centered_hypercube`
|
318
|
-
47. `six_dimensional_centered_hypercube`
|
319
|
-
48. `centered_polytope`
|
320
|
-
49. `k_dimensional_centered_hypertetrahedron(k)`
|
321
|
-
50. `five_dimensional_centered_hypertetrahedron(k)`
|
322
|
-
51. `six_dimensional_centered_hypertetrahedron(k)`
|
323
|
-
52. `centered_hyperoctahedral = orthoplex`
|
324
|
-
53. `nexus(k)`
|
325
|
-
54. `k_dimensional_centered_hyperoctahedron(k)`
|
326
|
-
55. `five_dimensional_centered_hyperoctahedron`
|
327
|
-
56. `six_dimensional_centered_hyperoctahedron`
|
328
|
-
57. `generalized_pentatope(left_index = 0)`
|
329
|
-
58. `generalized_k_dimensional_hypertetrahedron(k = 5, left_index = 0)`
|
330
|
-
59. `generalized_biquadratic(left_index = 0)`
|
331
|
-
60. `generalized_k_dimensional_hypercube(k = 5, left_index = 0)`
|
332
|
-
61. `generalized_hyperoctahedral(left_index = 0)`
|
333
|
-
62. `generalized_k_dimensional_hyperoctahedron(k = 5, left_index = 0) [even or odd dimension only changes sign]`
|
334
|
-
63. `generalized_hyperdodecahedral(left_index = 0)`
|
335
|
-
64. `generalized_hypericosahedral(left_index = 0)`
|
336
|
-
65. `generalized_polyoctahedral(left_index = 0)`
|
337
|
-
66. `generalized_k_dimensional_mgonal_pyramidal(k, m, left_index = 0)`
|
338
|
-
67. `generalized_k_dimensional_centered_hypercube(k, left_index = 0)`
|
339
|
-
68. `generalized_k_dimensional_centered_hypertetrahedron(k, left_index = 0)[provisional symmetry]`
|
340
|
-
69. `generalized_k_dimensional_centered_hyperoctahedron(k, left_index = 0)[provisional symmetry]`
|
341
|
-
70. `generalized_nexus(k, left_index = 0) [even or odd dimension only changes sign]`
|
342
|
-
|
343
|
-
### 6. Zoo of figurate-related numbers
|
344
|
-
|
345
|
-
1. `cuban_numbers = cuban_prime_numbers`
|
346
|
-
2. `quartan_numbers [Needs to improve the algorithmic complexity for n > 70]`
|
347
|
-
3. `pell_numbers`
|
348
|
-
4. `carmichael_numbers [Needs to improve the algorithmic complexity for n > 20]`
|
349
|
-
4. `stern_prime_numbers(infty = false) [Quick calculations up to 8 terms]`
|
350
|
-
5. `apocalyptic_numbers`
|
351
|
-
|
352
|
-
## Errata
|
353
|
-
|
354
|
-
- Chapter 1, formula in the table on page 6 says:
|
355
|
-
|
356
|
-
| Name | Formula | |
|
357
|
-
| ------ | ------------------- | --- |
|
358
|
-
| Square | `1/2 (n^2 - 0 * n)` | |
|
359
|
-
|
360
|
-
|
361
|
-
It should be:
|
362
|
-
| Name | Formula | |
|
363
|
-
| ------ | -------------------- | --- |
|
364
|
-
| Square | `1/2 (2n^2 - 0 * n)` | |
|
365
|
-
|
366
|
-
- Chapter 1, formula in the table on page 51 says:
|
367
|
-
|
368
|
-
| Name | Formula | |
|
369
|
-
| -------------------- | --------------------- | --------------------- |
|
370
|
-
| Cent. icosihexagonal | `1/3n^2 - 13 * n + 1` | `546, 728, 936, 1170` |
|
371
|
-
|
372
|
-
|
373
|
-
It should be:
|
374
|
-
| Name | Formula | |
|
375
|
-
| -------------------- | --------------------- | --------------------- |
|
376
|
-
| Cent. icosihexagonal | `1/3n^2 - 13 * n + 1` | `547, 729, 937, 1171` |
|
377
|
-
|
378
|
-
- Chapter 1, formula in the table on page 51 says:
|
379
|
-
|
380
|
-
| Name | Formula | |
|
381
|
-
| --------------------- | ------- | ----- |
|
382
|
-
| Cent. icosiheptagonal | | `972` |
|
383
|
-
|
384
|
-
|
385
|
-
It should be:
|
386
|
-
| Name | Formula | |
|
387
|
-
| --------------------- | ------- | ----- |
|
388
|
-
| Cent. icosiheptagonal | | `973` |
|
389
|
-
|
390
|
-
- Chapter 1, formula in the table on page 51 says:
|
391
|
-
|
392
|
-
| Name | Formula | |
|
393
|
-
| -------------------- | ------- | ---- |
|
394
|
-
| Cent. icosioctagonal | | `84` |
|
395
|
-
|
396
|
-
|
397
|
-
It should be:
|
398
|
-
| Name | Formula | |
|
399
|
-
| -------------------- | ------- | ---- |
|
400
|
-
| Cent. icosioctagonal | | `85` |
|
401
|
-
|
402
|
-
- Chapter 1, page 65 (polite numbers) says:
|
403
|
-
> `inpolite numbers`
|
404
|
-
|
405
|
-
It should read:
|
406
|
-
|
407
|
-
> `impolite numbers`
|
408
|
-
|
409
|
-
- Chapter 1, formula (truncated centered pentagonal numbers) on page 72 says:
|
410
|
-
> `TCSS_5(n) = (35n^2 - 55n) / 2 + 3`
|
411
|
-
|
412
|
-
It should be:
|
413
|
-
> `TCSS_5(n) = (35n^2 - 55n) / 2 + 11`
|
414
|
-
|
415
|
-
- Chapter 2, formula of octagonal pyramidal number on page 92 says:
|
416
|
-
> `n(n+1)(6n-1) / 6`
|
417
|
-
|
418
|
-
It should be:
|
419
|
-
> `n(n+1)(6n-3) / 6`
|
420
|
-
|
421
|
-
- Chapter 2, page 140 says:
|
422
|
-
> centered square pyramidal numbers are 1, 6, 19, 44, 85, 111, 146, 231, ...
|
423
|
-
|
424
|
-
This sequence must exclude the number 111:
|
425
|
-
|
426
|
-
> centered square pyramidal numbers are 1, 6, 19, 44, 85, ~~111~~, 146, 231, ...
|
427
|
-
|
428
|
-
- Chapter 2, page 155 (generalized centered tetrahedron numbers) says:
|
429
|
-
> `S_3^3(n) = ((2n - 1)(n^2 + n + 3)) / 3`
|
430
|
-
|
431
|
-
Formula must have a negative sign:
|
432
|
-
|
433
|
-
> `S_3^3(n) = ((2n - 1)(n^2 - n + 3)) / 3`
|
434
|
-
|
435
|
-
- Chapter 2, page 156 (generalized centered square pyramid numbers) says:
|
436
|
-
> `S_4^3(n) = ((2n - 1) * (n^2 - n + 2)^2) / 3`
|
437
|
-
|
438
|
-
Formula must write:
|
76
|
+
Simply copy the entry point path from the `lib/figurate_numbers.rb` file where the *gem* is installed.
|
439
77
|
|
440
|
-
|
78
|
+
### Version 1.3.0 (legacy)
|
441
79
|
|
442
|
-
|
443
|
-
> `hexadecahoron numbers`
|
80
|
+
See discussion in the [**Sonic Pi community thread right here!**](https://in-thread.sonic-pi.net/t/figurate-numbers-for-sonic-pi-new-ruby-gem-for-infinite-number-sequences-and-patterns/8962)
|
444
81
|
|
445
|
-
|
82
|
+
## 📚 List of Implemented Sequences in `figurate_numbers`
|
446
83
|
|
447
|
-
|
84
|
+
Explore the complete list of figurate number sequences and their Ruby methods:
|
448
85
|
|
449
|
-
-
|
450
|
-
> `hexacisihoron numbers`
|
86
|
+
- [View all implemented methods and sequences 🔍](docs/METHODS.md)
|
451
87
|
|
452
|
-
|
88
|
+
## 📝 Book Errata
|
453
89
|
|
454
|
-
|
90
|
+
Corrections to formulas and data found in *Figurate Numbers* (2012):
|
455
91
|
|
92
|
+
- [See full list of known errata 🔍](docs/ERRATA.md)
|
data/docs/ERRATA.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
## Errata
|
2
|
+
|
3
|
+
- **Chapter 1, page 6:**
|
4
|
+
The formula for *Square* in the table is given as:
|
5
|
+
`1/2 (n^2 - 0 * n)`
|
6
|
+
It should be corrected to:
|
7
|
+
`1/2 (2n^2 - 0 * n)`
|
8
|
+
|
9
|
+
- **Chapter 1, page 51:**
|
10
|
+
The formula for *Centered icosihexagonal* numbers is listed as:
|
11
|
+
`1/3n^2 - 13n + 1`
|
12
|
+
with values `546, 728, 936, 1170`.
|
13
|
+
The correct formula and values are:
|
14
|
+
`13n^2 - 13n + 1`
|
15
|
+
with values `547, 729, 937, 1171`.
|
16
|
+
|
17
|
+
- **Chapter 1, page 51:**
|
18
|
+
The value for *Centered icosiheptagonal* number is given as `972`.
|
19
|
+
The correct value is `973`.
|
20
|
+
|
21
|
+
- **Chapter 1, page 51:**
|
22
|
+
The value for *Centered icosioctagonal* number is given as `84`.
|
23
|
+
The correct value is `85`.
|
24
|
+
|
25
|
+
- **Chapter 1, page 65:**
|
26
|
+
The term *polite numbers* is misspelled as:
|
27
|
+
`inpolite numbers`
|
28
|
+
It should read:
|
29
|
+
`impolite numbers`
|
30
|
+
|
31
|
+
- **Chapter 1, page 72:**
|
32
|
+
The formula for truncated centered pentagonal numbers (TCSS_5) is:
|
33
|
+
`TCSS_5(n) = (35n^2 - 55n) / 2 + 3`
|
34
|
+
It should be:
|
35
|
+
`TCSS_5(n) = (35n^2 - 55n) / 2 + 11`
|
36
|
+
|
37
|
+
- **Chapter 2, page 92:**
|
38
|
+
The formula for octagonal pyramidal numbers is stated as:
|
39
|
+
`n(n+1)(6n-1) / 6`
|
40
|
+
The correct formula is:
|
41
|
+
`n(n+1)(6n-3) / 6`
|
42
|
+
|
43
|
+
- **Chapter 2, page 140:**
|
44
|
+
The sequence for centered square pyramidal numbers is listed as:
|
45
|
+
`1, 6, 19, 44, 85, 111, 146, 231, ...`
|
46
|
+
The number `111` should be excluded, resulting in:
|
47
|
+
`1, 6, 19, 44, 85, 146, 231, ...`
|
48
|
+
|
49
|
+
- **Chapter 2, page 155:**
|
50
|
+
The formula for generalized centered tetrahedron numbers (S_3^3) is:
|
51
|
+
`S_3^3(n) = ((2n - 1)(n^2 + n + 3)) / 3`
|
52
|
+
It should include a negative sign:
|
53
|
+
`S_3^3(n) = ((2n - 1)(n^2 - n + 3)) / 3`
|
54
|
+
|
55
|
+
- **Chapter 2, page 156:**
|
56
|
+
The formula for generalized centered square pyramid numbers (S_4^3) is:
|
57
|
+
`S_4^3(n) = ((2n - 1)(n^2 - n + 2)^2) / 3`
|
58
|
+
The correct formula is:
|
59
|
+
`S_4^3(n) = ((2n - 1)(n^2 - n + 2)) / 2`
|
60
|
+
|
61
|
+
- **Chapter 3, page 188:**
|
62
|
+
The term *hyperoctahedral numbers* is incorrectly called:
|
63
|
+
`hexadecahoron numbers`
|
64
|
+
It should be:
|
65
|
+
`hexadecachoron numbers`
|
66
|
+
|
67
|
+
- **Chapter 3, page 190:**
|
68
|
+
The term *hypericosahedral numbers* is incorrectly written as:
|
69
|
+
`hexacisihoron numbers`
|
70
|
+
It should be:
|
71
|
+
`hexacosichoron numbers`
|