Skip to content

Commit ad45fbf

Browse files
committed
dfg
1 parent 57a640d commit ad45fbf

12 files changed

Lines changed: 394 additions & 95 deletions

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ uuid = "b4b868b0-69a7-11e9-2db0-173b4e8e576c"
33
version = "0.2.0"
44

55
[deps]
6+
Atom = "c52e3926-4ff0-5f6e-af25-54175e0327b1"
67
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
78
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
89
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -11,6 +12,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1112
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
1213
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1314
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
15+
Juno = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
1416
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
1517
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1618

docs/src/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@ SetPartitions
538538
Sfactorial
539539
```
540540
```@docs
541+
ShapeOrderedPartitions
542+
```
543+
```@docs
541544
ShapePartitions
542545
```
543546
```@docs

src/BooleanOperations.jl

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ const ModuleBooleanOperations = ""
3333

3434
"""
3535
Return the binary expansions of nonnegative ``n`` and ``k``. If algo=max then pad the resulting int arrays with 0 to make them equally long. For example
36+
3637
BinDigits``(12, 17, max) = ([0, 0, 1, 1, 0], [1, 0, 0, 0, 1])``.
38+
3739
If algo=min then the arrays are truncated to the length of the smaller operand.
40+
3841
BinDigits``(12, 17, min) = ([0, 0, 1, 1], [1, 0, 0, 0])``.
42+
3943
These are the lists which are itemwise compared by the logical operators.
4044
"""
4145
function BinDigits(n::Int, k::Int, algo=max)
@@ -179,28 +183,28 @@ end
179183

180184
"""
181185
182-
Return n NAND n.
186+
Return ``n`` NAND ``n``.
183187
"""
184188
V035327(n) = Bits("NAND", n, n)
185189
# also : V035327(n) = Bits("NEG1", n, n+1, min)
186190

187191
"""
188192
189-
Return n EQV n.
193+
Return ``n`` EQV ``n``.
190194
"""
191195
V003817(n) = Bits("EQV", n, n)
192196
# sets a(0) = 1
193197

194198
"""
195199
196-
Return n AND n+1, using max length.
200+
Return ``n`` AND ``n+1``, using max length.
197201
"""
198202
V129760(n) = Bits("AND", n, n+1)
199203
# with offset 0
200204

201205
"""
202206
203-
Return n CIMP n+1, using max length.
207+
Return ``n`` CIMP ``n+1``, using max length.
204208
"""
205209
V142151(n) = Bits("CIMP", n, n+1)
206210

@@ -213,109 +217,109 @@ V142151(n) = Bits("CIMP", n, n+1)
213217

214218
"""
215219
216-
Return n NEG1 n+1, using max length.
220+
Return ``n`` NEG1 ``n+1``, using max length.
217221
"""
218222
V080079(n) = Bits("NEG1", n, n+1)
219223
# with offset 0
220224

221225
"""
222226
223-
Return n OR n+1, using max length.
227+
Return ``n`` OR ``n+1``, using max length.
224228
"""
225229
V086799(n) = Bits("OR", n, n+1)
226230
# with offset 0
227231

228232
"""
229233
230-
Return n OR 2n, using max length.
234+
Return ``n`` OR ``2n``, using max length.
231235
"""
232236
V163617(n) = Bits("OR", n, n<<1)
233237

234238
"""
235239
236-
Return n XOR n+1, using max length.
240+
Return ``n`` XOR ``n+1``, using max length.
237241
"""
238242
V038712(n) = Bits("XOR", n, n+1)
239243
# with offset 0
240244

241245
"""
242246
243-
Return max(1, 2n) - (n EQV n), using max length.
247+
Return max``(1, 2n) - (n`` EQV ``n)``, using max length.
244248
"""
245249
V006257(n) = max(1, 2n) - Bits("EQV", n, n)
246250

247251
"""
248252
249-
Return n XOR 2n, using max length.
253+
Return ``n`` XOR ``2n``, using max length.
250254
"""
251255
V048724(n) = Bits("XOR", n, n<<1)
252256

253257
"""
254258
255-
Return n XOR n>>1, using max length.
259+
Return ``n`` XOR ``n>>1``, using max length.
256260
"""
257261
V003188(n) = Bits("XOR", n, n>>1)
258262

259263
"""
260264
261-
Return n XOR n>>1, using min length.
265+
Return ``n`` XOR ``n>>1``, using min length.
262266
"""
263267
V038554(n) = Bits("XOR", n, n>>1, min)
264268
# with a(1) = 1
265269

266270
"""
267271
268-
Return n AND n>>1, using min length.
272+
Return ``n`` AND ``n>>1``, using min length.
269273
"""
270274
V048735(n) = Bits("AND", n, n>>1, min)
271275

272276
"""
273277
274-
Return n AND n<<1, using min length.
278+
Return ``n`` AND ``n<<1``, using min length.
275279
"""
276280
V213370(n) = Bits("AND", n, n<<1, min)
277281

278282
"""
279283
280-
Return n CNIMP n+1, using min length.
284+
Return ``n`` CNIMP ``n+1``, using min length.
281285
"""
282286
V080940(n) = Bits("CNIMP", n, n+1, min)
283287
# with a(0) = 1
284288

285289
"""
286290
287-
Return n XOR n+1, using min length.
291+
Return ``n`` XOR ``n+1``, using min length.
288292
"""
289293
V135521(n) = Bits("XOR", n, n+1, min)
290294
# prepend a(0) = 1
291295

292296
"""
293297
294-
Return n XOR k, using max length.
298+
Return ``n`` XOR ``k``, using max length.
295299
"""
296300
V051933(n, k) = Bits("XOR", n, k)
297301

298302
"""
299303
300-
Return (k-1 XOR n-k) + 1, using max length.
304+
Return ``(k-1`` XOR ``n-k) + 1``, using max length.
301305
"""
302306
L280172(n) = [Bits("XOR", k-1, n-k) + 1 for k in 1:n]
303307

304308
"""
305309
306-
Return n+1 CNIMP n, using max length.
310+
Return ``n+1`` CNIMP ``n``, using max length.
307311
"""
308312
V135481(n) = Bits("CNIMP", n+1, n)
309313

310314
"""
311315
312-
Return Sum``_{d|n} d & (n/d)``, where & is the bitwise AND operator.
316+
Return ``_{d|n} d & (n/d)``, where & is the bitwise AND operator.
313317
"""
314318
V327987(n) = sum([Bits("AND", d, div(n, d)) for d divisors(n)])
315319

316320
"""
317321
318-
Is V327987(n) = ``∑_{d|n} d & (n/d)`` = 0 ?
322+
Is V327987(n) = ``∑_{d|n} d & (n/d) = 0`` ?
319323
"""
320324
is327988(n) = V327987(n) == 0
321325

src/BuildSequences.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,29 @@ function addsig(srcfile, docfile)
474474
end
475475
end
476476

477+
478+
# Version information
479+
version() = v"0.3.0-dev"
480+
481+
function versioninfo()
482+
print("IntegerSequences version $(version())\n")
483+
isrepo = dirname(dirname(@__FILE__))
484+
485+
print("IntegerSequences: ")
486+
prepo = Base.LibGit2.GitRepo(isrepo)
487+
Base.LibGit2.with(LibGit2.head(prepo)) do phead
488+
print("commit: ")
489+
print(string(LibGit2.Oid(phead))[1:8])
490+
print(" date: ")
491+
commit = Base.LibGit2.get(Base.LibGit2.GitCommit, prepo, LibGit2.Oid(phead))
492+
print(Base.Dates.unix2datetime(Base.LibGit2.author(commit).time))
493+
print(")\n")
494+
end
495+
496+
finalize(prepo)
497+
return nothing
498+
end
499+
477500
function build_all()
478501

479502
build_seq()

src/CantorMachines.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040

4141
"""
4242
43-
The Cantor enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) can become arbitrarily large. In this sense Cantor's enumeration is not continous.
43+
The Cantor enumeration of X where ℕ ``= {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` can become arbitrarily large. In this sense Cantor's enumeration is not continous.
4444
"""
4545
function CantorEnumeration(len)
4646
x, y, state = 0, 0, false
@@ -53,7 +53,7 @@ end
5353

5454
"""
5555
56-
The inverse function of the Cantor enumeration (the pairing function), computes n for given (x, y) and returns (x + y)*(x + y + 1)/2 + p where p = x if x - y is odd and y otherwise.
56+
The inverse function of the Cantor enumeration (the pairing function), computes n for given ``(x, y)`` and returns ``(x + y)(x + y + 1)/2 + p`` where ``p = x`` if ``x - y`` is odd and ``y`` otherwise.
5757
"""
5858
function CantorPairing(x, y)
5959
p = isodd(x - y) ? x : y
@@ -74,7 +74,7 @@ end
7474

7575
"""
7676
77-
# The boustrophedonic Cantor enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) is always 1 whereas for the Cantor enumeration this quantity can become arbitrarily large. In this sense the boustrophedonic variant is continuous whereas Cantor's realization is not.
77+
The boustrophedonic Cantor enumeration of X where ``ℕ = {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` is always 1 whereas for the Cantor enumeration this quantity can become arbitrarily large. In this sense the boustrophedonic variant is continuous whereas Cantor's realization is not.
7878
"""
7979
function CantorBoustrophedonicEnumeration(len)
8080
x, y = 0, 0
@@ -87,7 +87,7 @@ end
8787

8888
"""
8989
90-
The inverse function of the boustrophedonic Cantor enumeration (the pairing function), computes n for given (x, y) and returns (x + y)*(x + y + 1)/2 + m where m = abs(x - y) - (x > y ? 1 : 0).
90+
The inverse function of the boustrophedonic Cantor enumeration (the pairing function), computes n for given ``(x, y)`` and returns ``(x + y)(x + y + 1)/2 + m`` where ``m = abs(x - y) - (x > y ? 1 : 0)``.
9191
"""
9292
function CantorBoustrophedonicPairing(x, y)
9393
m = abs(x - y) - (x > y ? 1 : 0)
@@ -113,7 +113,7 @@ end
113113

114114
"""
115115
116-
The boustrophedonic Rosenberg-Strong enumeration of N X N where N = {0, 1, 2, ...}. If (x, y) and (x', y') are adjacent points on the trajectory of the map then max(|x - x'|, |y - y'|) is always 1 whereas the Rosenberg-Strong realization is not.
116+
The boustrophedonic Rosenberg-Strong enumeration of X where ℕ ``= {0, 1, 2, ...}``. If ``(x, y)`` and ``(x', y')`` are adjacent points on the trajectory of the map then max``(|x - x'|, |y - y'|)`` is always 1 whereas the Rosenberg-Strong realization is not.
117117
"""
118118
function RosenbergStrongBoustrophedonicEnumeration(len)
119119
x, y, state = 0, 0, 0
@@ -126,7 +126,7 @@ end
126126

127127
"""
128128
129-
The inverse function of the boustrophedonic Rosenberg-Strong enumeration (the pairing function), computes n for given (x, y).
129+
The inverse function of the boustrophedonic Rosenberg-Strong enumeration (the pairing function), computes ``n`` for given ``(x, y)``.
130130
"""
131131
function RosenbergStrongBoustrophedonicPairing(x::Int, y::Int)
132132
m = max(x, y)
@@ -136,7 +136,7 @@ end
136136

137137
"""
138138
139-
Return the pair (x, y) for given n as given by the boustrophedonic Rosenberg-Strong enumeration.
139+
Return the pair ``(x, y)`` for given n as given by the boustrophedonic Rosenberg-Strong enumeration.
140140
"""
141141
function V319514(n)
142142
k, r = divrem(n, 2)
@@ -148,7 +148,7 @@ end
148148

149149
"""
150150
151-
Return a list of pairs (x, y) given by the boustrophedonic Rosenberg-Strong enumeration.
151+
Return a list of pairs ``(x, y)`` given by the boustrophedonic Rosenberg-Strong enumeration.
152152
"""
153153
L319514(len) = [V319514(n) for n 0:len-1]
154154

src/CyclotomicBinaryForms.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const ModuleCyclotomicBinaryForms = ""
3232
#A206942########################################################################
3333
"""
3434
35-
Is ``n`` a numbers of the form ``Phi_k(m)`` with ``k > 2`` and ``|m| > 1``
36-
where ``Phi_k(m)`` denotes the ``k``-th cyclotomic polynomial evaluated at ``m``.
35+
Is ``n`` a numbers of the form ``𝚽_k(m)`` with ``k > 2`` and ``|m| > 1``
36+
where ``𝚽_k(m)`` denotes the ``k``-th cyclotomic polynomial evaluated at ``m``.
3737
"""
3838
function is206942(n)
3939
if n < 3

0 commit comments

Comments
 (0)