File: figurate.man

package info (click to toggle)
tcllib 2.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,560 kB
  • sloc: tcl: 306,798; ansic: 14,272; sh: 3,035; xml: 1,766; yacc: 1,157; pascal: 881; makefile: 124; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (373 lines) | stat: -rw-r--r-- 9,123 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
[manpage_begin math::figurate n 1.1]
[keywords {figurate numbers}]
[keywords mathematics]
[moddesc {Tcl Math Library}]
[titledesc {Evaluate figurate numbers}]
[category  Mathematics]
[require Tcl "8.6 9"]
[require math::figurate 1.0]
[description]
[para]

Sums of numbers that follow a particular pattern are called figurate numbers.
A simple example is the sum of integers 1, 2, ... up to n. You can arrange
1, 1+2=3, 1+2+3=6, ... objects in a triangle, hence the name triangular
numbers:
[example {
       *
       *  *
       *  *  *
       *  *  *  *
       ...
}]

The [package math::figurate] package consists of a collection of procedures to
evaluate a wide variety of figurate numbers. While all formulae are
straightforward, the details are sometimes puzzling.

[emph Note:] The procedures consider arguments lower than zero as to mean "no objects to be counted"
and therefore return 0.

[section "PROCEDURES"]
The procedures can be arranged in a few categories: sums of integers raised to a
particular power, sums of odd integers and general figurate numbers, for
instance the pentagonal numbers.

[list_begin definitions]

[call [cmd ::math::figurate::sum_sequence] [arg n]]
Return the sum of integers 1, 2, ..., n.

[list_begin arguments]
[arg_def int n] Highest integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_squares] [arg n]]
Return the sum of squares 1**2, 2**2, ..., n**2.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_cubes] [arg n]]
Return the sum of cubes 1**3, 2**3, ..., n**3.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_4th_power] [arg n]]
Return the sum of 4th powers 1**4, 2**4, ..., n**4.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_5th_power] [arg n]]
Return the sum of 5th powers 1**5, 2**5, ..., n**5.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_6th_power] [arg n]]
Return the sum of 6th powers 1**6, 2**6, ..., n**6.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_7th_power] [arg n]]
Return the sum of 7th powers 1**7, 2**7, ..., n**7.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]

[call [cmd ::math::figurate::sum_8th_power] [arg n]]
Return the sum of 8th powers 1**8, 2**8, ..., n**8.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_9th_power] [arg n]]
Return the sum of 9th powers 1**9, 2**9, ..., n**9.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_10th_power] [arg n]]
Return the sum of 10th powers 1**10, 2**10, ..., n**10.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]


[call [cmd ::math::figurate::sum_sequence_odd] [arg n]]
Return the sum of odd integers 1, 3, ..., 2n-1

[list_begin arguments]
[arg_def int n] Highest integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_squares_odd] [arg n]]
Return the sum of odd squares 1**2, 3**2, ..., (2n-1)**2.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_cubes_odd] [arg n]]
Return the sum of odd cubes 1**3, 3**3, ..., (2n-1)**3.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_4th_power_odd] [arg n]]
Return the sum of odd 4th powers 1**4, 2**4, ..., (2n-1)**4.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_5th_power_odd] [arg n]]
Return the sum of odd 5th powers 1**5, 2**5, ..., (2n-1)**5.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_6th_power_odd] [arg n]]
Return the sum of odd 6th powers 1**6, 2**6, ..., (2n-1)**6.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_7th_power_odd] [arg n]]
Return the sum of odd 7th powers 1**7, 2**7, ..., (2n-1)**7.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]

[call [cmd ::math::figurate::sum_8th_power_odd] [arg n]]
Return the sum of odd 8th powers 1**8, 2**8, ..., (2n-1)**8.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_9th_power_odd] [arg n]]
Return the sum of odd 9th powers 1**9, 2**9, ..., (2n-1)**9.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]

[call [cmd ::math::figurate::sum_10th_power_odd] [arg n]]
Return the sum of odd 10th powers 1**10, 2**10, ..., (2n-1)**10.

[list_begin arguments]
[arg_def int n] Highest base integer in the sum
[list_end]
[para]


[call [cmd ::math::figurate::oblong] [arg n]]
Return the nth oblong number (twice the nth triangular number)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::pronic] [arg n]]
Return the nth pronic number (synonym for oblong)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::triangular] [arg n]]
Return the nth triangular number

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::square] [arg n]]
Return the nth square number

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::cubic] [arg n]]
Return the nth cubic number

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::biquadratic] [arg n]]
Return the nth biquaratic number (i.e. n**4)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::centeredTriangular] [arg n]]
Return the nth centered triangular number (items arranged in concentric
squares)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::centeredSquare] [arg n]]
Return the nth centered square number (items arranged in concentric squares)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::centeredPentagonal] [arg n]]
Return the nth centered pentagonal number (items arranged in concentric
pentagons)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::centeredHexagonal] [arg n]]
Return the nth centered hexagonal number (items arranged in concentric
hexagons)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::centeredCube] [arg n]]
Return the nth centered cube number (items arranged in concentric
cubes)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::decagonal] [arg n]]
Return the nth decagonal number (items arranged in decagons with one common
vertex)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::heptagonal] [arg n]]
Return the nth heptagonal number (items arranged in heptagons with one
common vertex)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::hexagonal] [arg n]]
Return the nth hexagonal number (items arranged in hexagons with one
common vertex)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::octagonal] [arg n]]
Return the nth octagonal number (items arranged in octagons with one
common vertex)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::octahedral] [arg n]]
Return the nth octahedral number (items arranged in octahedrons with a
common centre)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::pentagonal] [arg n]]
Return the nth pentagonal number (items arranged in pentagons with one
common vertex)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::squarePyramidral] [arg n]]
Return the nth square pyramidral number (items arranged in a square pyramid)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::tetrahedral] [arg n]]
Return the nth tetrahedral number (items arranged in a triangular pyramid)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[call [cmd ::math::figurate::pentatope] [arg n]]
Return the nth pentatope number (items arranged in the four-dimensional analogue
of a triangular pyramid)

[list_begin arguments]
[arg_def int n] Required index
[list_end]
[para]

[list_end]

[vset CATEGORY {math :: figurate}]
[include ../common-text/feedback.inc]
[manpage_end]