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
|
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch1}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull1}{IntegerNumberTheoryFunctionsXmpPageEmpty1}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull1}{\hidepaste}
\tab{5}\spadcommand{div144 := divisors(144)\bound{div144 }}
\indentrel{3}\begin{verbatim}
(1) [1,2,3,4,6,8,9,12,16,18,24,36,48,72,144]
Type: List Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty1}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty1}{IntegerNumberTheoryFunctionsXmpPagePatch1}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty1}{\showpaste}
\tab{5}\spadcommand{div144 := divisors(144)\bound{div144 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch2}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull2}{IntegerNumberTheoryFunctionsXmpPageEmpty2}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull2}{\hidepaste}
\tab{5}\spadcommand{\#(div144)\free{div144 }}
\indentrel{3}\begin{verbatim}
(2) 15
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty2}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty2}{IntegerNumberTheoryFunctionsXmpPagePatch2}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty2}{\showpaste}
\tab{5}\spadcommand{\#(div144)\free{div144 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch3}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull3}{IntegerNumberTheoryFunctionsXmpPageEmpty3}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull3}{\hidepaste}
\tab{5}\spadcommand{reduce(+,div144)\free{div144 }}
\indentrel{3}\begin{verbatim}
(3) 403
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty3}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty3}{IntegerNumberTheoryFunctionsXmpPagePatch3}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty3}{\showpaste}
\tab{5}\spadcommand{reduce(+,div144)\free{div144 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch4}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull4}{IntegerNumberTheoryFunctionsXmpPageEmpty4}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull4}{\hidepaste}
\tab{5}\spadcommand{numberOfDivisors(144)}
\indentrel{3}\begin{verbatim}
(4) 15
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty4}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty4}{IntegerNumberTheoryFunctionsXmpPagePatch4}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty4}{\showpaste}
\tab{5}\spadcommand{numberOfDivisors(144)}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch5}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull5}{IntegerNumberTheoryFunctionsXmpPageEmpty5}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull5}{\hidepaste}
\tab{5}\spadcommand{sumOfDivisors(144)}
\indentrel{3}\begin{verbatim}
(5) 403
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty5}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty5}{IntegerNumberTheoryFunctionsXmpPagePatch5}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty5}{\showpaste}
\tab{5}\spadcommand{sumOfDivisors(144)}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch6}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull6}{IntegerNumberTheoryFunctionsXmpPageEmpty6}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull6}{\hidepaste}
\tab{5}\spadcommand{f1(n) == reduce(+,[moebiusMu(d) * numberOfDivisors(quo(n,d)) for d in divisors(n)])\bound{f1 }}
\indentrel{3}\begin{verbatim}
Type: Void
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty6}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty6}{IntegerNumberTheoryFunctionsXmpPagePatch6}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty6}{\showpaste}
\tab{5}\spadcommand{f1(n) == reduce(+,[moebiusMu(d) * numberOfDivisors(quo(n,d)) for d in divisors(n)])\bound{f1 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch7}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull7}{IntegerNumberTheoryFunctionsXmpPageEmpty7}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull7}{\hidepaste}
\tab{5}\spadcommand{f1(200)\free{f1 }}
\indentrel{3}\begin{verbatim}
(7) 1
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty7}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty7}{IntegerNumberTheoryFunctionsXmpPagePatch7}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty7}{\showpaste}
\tab{5}\spadcommand{f1(200)\free{f1 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch8}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull8}{IntegerNumberTheoryFunctionsXmpPageEmpty8}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull8}{\hidepaste}
\tab{5}\spadcommand{f1(846)\free{f1 }}
\indentrel{3}\begin{verbatim}
(8) 1
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty8}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty8}{IntegerNumberTheoryFunctionsXmpPagePatch8}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty8}{\showpaste}
\tab{5}\spadcommand{f1(846)\free{f1 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch9}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull9}{IntegerNumberTheoryFunctionsXmpPageEmpty9}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull9}{\hidepaste}
\tab{5}\spadcommand{f2(n) == reduce(+,[moebiusMu(d) * sumOfDivisors(quo(n,d)) for d in divisors(n)])\bound{f2 }}
\indentrel{3}\begin{verbatim}
Type: Void
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty9}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty9}{IntegerNumberTheoryFunctionsXmpPagePatch9}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty9}{\showpaste}
\tab{5}\spadcommand{f2(n) == reduce(+,[moebiusMu(d) * sumOfDivisors(quo(n,d)) for d in divisors(n)])\bound{f2 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch10}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull10}{IntegerNumberTheoryFunctionsXmpPageEmpty10}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull10}{\hidepaste}
\tab{5}\spadcommand{f2(200)\free{f2 }}
\indentrel{3}\begin{verbatim}
(10) 200
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty10}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty10}{IntegerNumberTheoryFunctionsXmpPagePatch10}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty10}{\showpaste}
\tab{5}\spadcommand{f2(200)\free{f2 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch11}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull11}{IntegerNumberTheoryFunctionsXmpPageEmpty11}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull11}{\hidepaste}
\tab{5}\spadcommand{f2(846)\free{f2 }}
\indentrel{3}\begin{verbatim}
(11) 846
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty11}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty11}{IntegerNumberTheoryFunctionsXmpPagePatch11}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty11}{\showpaste}
\tab{5}\spadcommand{f2(846)\free{f2 }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch12}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull12}{IntegerNumberTheoryFunctionsXmpPageEmpty12}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull12}{\hidepaste}
\tab{5}\spadcommand{fibonacci(25)}
\indentrel{3}\begin{verbatim}
(12) 75025
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty12}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty12}{IntegerNumberTheoryFunctionsXmpPagePatch12}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty12}{\showpaste}
\tab{5}\spadcommand{fibonacci(25)}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch13}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull13}{IntegerNumberTheoryFunctionsXmpPageEmpty13}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull13}{\hidepaste}
\tab{5}\spadcommand{[fibonacci(n) for n in 1..15]}
\indentrel{3}\begin{verbatim}
(13) [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610]
Type: List Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty13}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty13}{IntegerNumberTheoryFunctionsXmpPagePatch13}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty13}{\showpaste}
\tab{5}\spadcommand{[fibonacci(n) for n in 1..15]}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch14}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull14}{IntegerNumberTheoryFunctionsXmpPageEmpty14}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull14}{\hidepaste}
\tab{5}\spadcommand{fib(n) == reduce(+,[binomial(n-1-k,k) for k in 0..quo(n-1,2)])\bound{fib }}
\indentrel{3}\begin{verbatim}
Type: Void
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty14}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty14}{IntegerNumberTheoryFunctionsXmpPagePatch14}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty14}{\showpaste}
\tab{5}\spadcommand{fib(n) == reduce(+,[binomial(n-1-k,k) for k in 0..quo(n-1,2)])\bound{fib }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch15}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull15}{IntegerNumberTheoryFunctionsXmpPageEmpty15}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull15}{\hidepaste}
\tab{5}\spadcommand{fib(25)\free{fib }}
\indentrel{3}\begin{verbatim}
(15) 75025
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty15}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty15}{IntegerNumberTheoryFunctionsXmpPagePatch15}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty15}{\showpaste}
\tab{5}\spadcommand{fib(25)\free{fib }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch16}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull16}{IntegerNumberTheoryFunctionsXmpPageEmpty16}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull16}{\hidepaste}
\tab{5}\spadcommand{[fib(n) for n in 1..15]\free{fib }}
\indentrel{3}\begin{verbatim}
(16) [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610]
Type: List Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty16}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty16}{IntegerNumberTheoryFunctionsXmpPagePatch16}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty16}{\showpaste}
\tab{5}\spadcommand{[fib(n) for n in 1..15]\free{fib }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch17}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull17}{IntegerNumberTheoryFunctionsXmpPageEmpty17}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull17}{\hidepaste}
\tab{5}\spadcommand{legendre(3,5)}
\indentrel{3}\begin{verbatim}
(17) - 1
Type: Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty17}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty17}{IntegerNumberTheoryFunctionsXmpPagePatch17}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty17}{\showpaste}
\tab{5}\spadcommand{legendre(3,5)}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch18}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull18}{IntegerNumberTheoryFunctionsXmpPageEmpty18}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull18}{\hidepaste}
\tab{5}\spadcommand{legendre(23,691)}
\indentrel{3}\begin{verbatim}
(18) - 1
Type: Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty18}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty18}{IntegerNumberTheoryFunctionsXmpPagePatch18}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty18}{\showpaste}
\tab{5}\spadcommand{legendre(23,691)}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch19}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull19}{IntegerNumberTheoryFunctionsXmpPageEmpty19}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull19}{\hidepaste}
\tab{5}\spadcommand{h(d) == quo(reduce(+, [jacobi(d,k) for k in 1..quo(-d, 2)]), 2 - jacobi(d,2))\bound{h }}
\indentrel{3}\begin{verbatim}
Type: Void
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty19}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty19}{IntegerNumberTheoryFunctionsXmpPagePatch19}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty19}{\showpaste}
\tab{5}\spadcommand{h(d) == quo(reduce(+, [jacobi(d,k) for k in 1..quo(-d, 2)]), 2 - jacobi(d,2))\bound{h }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch20}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull20}{IntegerNumberTheoryFunctionsXmpPageEmpty20}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull20}{\hidepaste}
\tab{5}\spadcommand{h(-163)\free{h }}
\indentrel{3}\begin{verbatim}
(20) 1
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty20}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty20}{IntegerNumberTheoryFunctionsXmpPagePatch20}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty20}{\showpaste}
\tab{5}\spadcommand{h(-163)\free{h }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch21}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull21}{IntegerNumberTheoryFunctionsXmpPageEmpty21}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull21}{\hidepaste}
\tab{5}\spadcommand{h(-499)\free{h }}
\indentrel{3}\begin{verbatim}
(21) 3
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty21}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty21}{IntegerNumberTheoryFunctionsXmpPagePatch21}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty21}{\showpaste}
\tab{5}\spadcommand{h(-499)\free{h }}
\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPagePatch22}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageFull22}{IntegerNumberTheoryFunctionsXmpPageEmpty22}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageFull22}{\hidepaste}
\tab{5}\spadcommand{h(-1832)\free{h }}
\indentrel{3}\begin{verbatim}
(22) 26
Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}
\begin{patch}{IntegerNumberTheoryFunctionsXmpPageEmpty22}
\begin{paste}{IntegerNumberTheoryFunctionsXmpPageEmpty22}{IntegerNumberTheoryFunctionsXmpPagePatch22}
\pastebutton{IntegerNumberTheoryFunctionsXmpPageEmpty22}{\showpaste}
\tab{5}\spadcommand{h(-1832)\free{h }}
\end{paste}\end{patch}
|