Skip to content

Commit c2c2daa

Browse files
committed
gauss
1 parent ef6bd9f commit c2c2daa

9 files changed

Lines changed: 208 additions & 51 deletions

File tree

docs/src/index.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ FallingFactorial
103103
GammaHyp
104104
```
105105
```@docs
106-
GaußFactorial
106+
GaussFactorial
107107
```
108108
```@docs
109109
HilbertHotel
@@ -178,7 +178,7 @@ ModuleFibonacci
178178
ModuleFigurativeNumbers
179179
```
180180
```@docs
181-
ModuleGaussFactorial
181+
ModuleGaussFactorials
182182
```
183183
```@docs
184184
ModuleGeneralizedBinomial
@@ -823,6 +823,9 @@ T001497
823823
L001710
824824
```
825825
```@docs
826+
V001783
827+
```
828+
```@docs
826829
V001813
827830
```
828831
```@docs
@@ -1381,6 +1384,9 @@ T053121
13811384
V054248
13821385
```
13831386
```@docs
1387+
V055634
1388+
```
1389+
```@docs
13841390
T055883
13851391
```
13861392
```@docs
@@ -1432,6 +1438,9 @@ L065855
14321438
T066325
14331439
```
14341440
```@docs
1441+
V066570
1442+
```
1443+
```@docs
14351444
V067998
14361445
```
14371446
```@docs
@@ -1615,6 +1624,12 @@ V123753
16151624
V124320
16161625
```
16171626
```@docs
1627+
V124441
1628+
```
1629+
```@docs
1630+
V124442
1631+
```
1632+
```@docs
16181633
T132062
16191634
```
16201635
```@docs
@@ -1741,6 +1756,9 @@ L214551
17411756
T216916
17421757
```
17431758
```@docs
1759+
V216919
1760+
```
1761+
```@docs
17441762
T217537
17451763
```
17461764
```@docs
@@ -1759,6 +1777,15 @@ I225498
17591777
L225498
17601778
```
17611779
```@docs
1780+
V232980
1781+
```
1782+
```@docs
1783+
V232981
1784+
```
1785+
```@docs
1786+
V232982
1787+
```
1788+
```@docs
17621789
L242660
17631790
```
17641791
```@docs

docs/src/modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ Applying Deléham's Δ-operation often gives an additional first column or an ad
130130

131131
* PolygonalNumber, PyramidalNumber, V014107, V095794, V067998, V080956, V001477, V000217, V000290, V000326, V000384, V000566, V000567, V001106, V001107, V005564, V058373, V254749, V000292, V000330, V002411, V002412, V002413, V002414, V007584, V007585
132132

133-
  🔶  [GaussFactorial](https://github.com/OpenLibMathSeq/IntegerSequences.jl/blob/master/src/GaussFactorial.jl)
133+
  🔶  [GaussFactorials](https://github.com/OpenLibMathSeq/IntegerSequences.jl/blob/master/src/GaussFactorials.jl)
134134

135135
The Gauß factorial is ``∏_{1 ≤ j ≤ N, j ⊥ n} j``, the product of the positive integers which are ``≤ N`` and are prime to ``n``.
136136

137-
* GaußFactorial, I193338, F193338, L193338, V193338, I193339, F193339, L193339, V193339
137+
* GaussFactorial, I193338, F193338, L193338, V193338, I193339, F193339, L193339, V193339, V216919, V001783, V055634, V232980, V232981, V232982, V124441, V124442, V066570
138138

139139
  🔶  [GeneralizedBinomial](https://github.com/OpenLibMathSeq/IntegerSequences.jl/blob/master/src/GeneralizedBinomial.jl)
140140

Lines changed: 83 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,93 @@
33

44
(@__DIR__) LOAD_PATH && push!(LOAD_PATH, (@__DIR__))
55

6-
module GaussFactorial
6+
module GaussFactorials
77

88
using Nemo, IterTools
99
using RecordSearch, NumberTheory, Products
1010

11-
export ModuleGaussFactorial, GaußFactorial
11+
export ModuleGaussFactorials, GaussFactorial
12+
export V216919, V001783, V055634, V232980, V232981, V232982, V124441, V124442, V066570
1213
export I193338, F193338, L193338, V193338
1314
export I193339, F193339, L193339, V193339
1415

1516
"""
1617
The Gauß factorial is ``∏_{1 ≤ j ≤ N, j ⊥ n} j``, the product of the positive integers which are ``≤ N`` and are prime to ``n``.
1718
18-
* GaußFactorial, I193338, F193338, L193338, V193338, I193339, F193339, L193339, V193339
19+
* GaussFactorial, I193338, F193338, L193338, V193338, I193339, F193339, L193339, V193339, V216919, V001783, V055634, V232980, V232981, V232982, V124441, V124442, V066570
1920
"""
20-
const ModuleGaussFactorial = ""
21-
22-
# A216919
21+
const ModuleGaussFactorials = ""
2322

2423
"""
2524
Return ``∏_{1 ≤ j ≤ N, j ⊥ n} j``, the product of the positive integers which are ``≤ N`` and are prime to ``n``.
2625
"""
27-
GaußFactorial(n) = prod([j for j in 1:Int(n) if (j, n)])
26+
GaussFactorial(N, n) = ([j for j in 1:Int(N) if (j, n)])
27+
28+
"""
29+
Return ``∏_{1 ≤ j ≤ n, j ⊥ n} j``, the product of the positive integers which are ``≤ n`` and are prime to ``n``.
30+
"""
31+
GaussFactorial(n) = GaussFactorial(n, n)
32+
33+
# V000142(n) = n! = GaussFactorial(n, 1).
34+
# V001147(n) = GaussFactorial(2*n, 2), double factorial of odd numbers.
35+
36+
"""
37+
Return GaussFactorial(N, n).
38+
"""
39+
V216919(N, n) = GaussFactorial(N, n)
40+
41+
"""
42+
Return ``∏_{1 ≤ j ≤ n, j ⊥ n} j``, the product of the positive integers which are ``≤ N`` and are prime to ``n``, a.k.a. the phi-torial of n.
43+
"""
44+
V001783(n) = GaussFactorial(n, n)
45+
46+
"""
47+
Return the 2-adic factorial of n.
48+
"""
49+
V055634(n) = GaussFactorial(n, 2)*(-1)^n
50+
51+
"""
52+
Return GaussFactorial(n, 3).
53+
"""
54+
V232980(n) = GaussFactorial(n, 3)
55+
56+
"""
57+
Return GaussFactorial(n, 5).
58+
"""
59+
V232981(n) = GaussFactorial(n, 5)
60+
61+
"""
62+
Return GaussFactorial(n, 6).
63+
"""
64+
V232982(n) = GaussFactorial(n, 6)
65+
66+
"""
67+
Return GaussFactorial(div(n, 2), n).
68+
"""
69+
V124441(n) = GaussFactorial(div(n, 2), n)
70+
71+
"""
72+
Return GaussFactorial(n, n)/GaussFactorial(div(n, 2), n).
73+
"""
74+
V124442(n) = div(GaussFactorial(n, n), GaussFactorial(div(n, 2), n))
75+
76+
"""
77+
Return GaussFactorial(n, 1)/GaussFactorial(n, n).
78+
"""
79+
V066570(n) = div(GaussFactorial(n, 1), GaussFactorial(n, n))
2880

2981
# -----------------------------------------------------------------
3082
# Indices!
3183

3284
"""
3385
Iterate over the indices of the first ``n`` record values of the Gauß factorial.
3486
"""
35-
I193339(n) = Records(GaußFactorial, n, true, true)
87+
I193339(n) = Records(GaussFactorial, n, true, true)
3688

3789
"""
3890
Iterate over indices of the record values of the Gauß factorial which do not exceed ``n`` (``1 ≤ i ≤ n``).
3991
"""
40-
F193339(n) = Records(GaußFactorial, n, false, true)
92+
F193339(n) = Records(GaussFactorial, n, false, true)
4193

4294
"""
4395
Return the indices of the first ``n`` record values of the Gauß factorial as an array.
@@ -55,12 +107,12 @@ V193339(n) = nth(I193339(n), n)
55107
"""
56108
Iterate over the first ``n`` record values of the Gauß factorial (``1 ≤ r``).
57109
"""
58-
I193338(n) = Records(GaußFactorial, n, true, false)
110+
I193338(n) = Records(GaussFactorial, n, true, false)
59111

60112
"""
61113
Iterate over the record values of the Gauß factorial which do not exceed ``n`` (``1 ≤ i ≤ n``).
62114
"""
63-
F193338(n) = Records(GaußFactorial, n, false, false)
115+
F193338(n) = Records(GaussFactorial, n, false, false)
64116

65117
"""
66118
Return the first ``n`` record values of the Gauß factorial as an array.
@@ -74,14 +126,25 @@ V193338(n) = nth(I193338(n), n)
74126

75127
#START-TEST-########################################################
76128

77-
using Test
129+
using Test, SeqTests
78130

79131
function test()
132+
133+
@testset "GaussFactorial" begin
134+
135+
#@test
136+
if is_oeis_installed()
137+
138+
V = [V001783, V124441, V124442, V066570]
139+
for v in V SeqTest(v, 'V', 1) end
140+
141+
W = [V055634, V232980, V232981, V232982]
142+
for w in W SeqTest(w, 'V', 0) end
143+
end
144+
end
80145
end
81146

82147
function demo()
83-
# 1, 3, 4, 5, 7, 9, 11, 13, 17, 19, ...
84-
85148
println("\n Iterate over the indices of the first 10 record values of the Gauß factorial.")
86149
for r in I193339(10) print(r, ", ") end; println("...")
87150

@@ -122,26 +185,26 @@ end # module
122185

123186
#=
124187
Iterate over the indices of the first 10 record values ofthe Gauß factorial.
125-
0, 0, 3, 4, 5, 7, 9, 11, 13, 17, ...
188+
1, 3, 4, 5, 7, 9, 11, 13, 17, ...
126189
127190
Iterate over indices of the record values of the Gauß factorial which do not exceed 10.
128-
0, 0, 3, 4, 5, 7, 9, ...
191+
1, 3, 4, 5, 7, 9, ...
129192
130193
Return the indices of the first 10 record values of the Gauß factorial as an array.
131-
Nemo.fmpz[0, 0, 3, 4, 5, 7, 9, 11, 13, 17]
194+
Nemo.fmpz[1, 3, 4, 5, 7, 9, 11, 13, 17]
132195
133196
Return the index of the 9-th record value of the Gauß factorial.
134197
9 -> 13
135198
136199
Iterate over the first 10 record values of the Gauß factorial.
137-
0, 1, 2, 3, 24, 720, 2240, 3628800, 479001600, 20922789888000, ...
200+
1, 2, 3, 24, 720, 2240, 3628800, 479001600, 20922789888000, ...
138201
139202
Iterate over the record values of Gauß factorial which do
140203
not exceed 10.
141-
0, 1, 2, 3, 24, 720, 2240, ...
204+
1, 2, 3, 24, 720, 2240, ...
142205
143206
Return the first 10 record values of the Gauß factorial as an array.
144-
Nemo.fmpz[0, 1, 2, 3, 24, 720, 2240, 3628800, 479001600, 20922789888000]
207+
Nemo.fmpz[1, 2, 3, 24, 720, 2240, 3628800, 479001600, 20922789888000]
145208
146209
Return the (value of the) 9-th record of the Gauß factorial.
147210
9 -> 479001600

src/HighlyAbundant.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,25 @@ end # module
118118

119119
#=
120120
Iterate over the first 20 highly abundant numbers.
121-
0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 36, 42, 48, 60, 72, 84, ...
121+
1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 36, 42, 48, 60, 72, 84, ...
122122
123123
Return the first 20 highly abundant numbers as an array.
124-
Nemo.fmpz[0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 36, 42, 48, 60, 72, 84]
124+
Nemo.fmpz[1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 36, 42, 48, 60, 72, 84]
125125
126126
Iterate over the highly abundant numbers which do not exceed 20.
127-
0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, ...
127+
1, 2, 3, 4, 6, 8, 10, 12, 16, 18, 20, ...
128128
129129
Return the 9-th highly abundant number.
130130
9 -> 12
131131
132132
Iterate over the first 20 record values of sigma.
133-
0, 1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, 60, 72, 91, 96, 124, 168, 195, 224, ...
133+
1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, 60, 72, 91, 96, 124, 168, 195, 224, ...
134134
135135
Return the first 20 record values of sigma as an array.
136-
Nemo.fmpz[0, 1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, 60, 72, 91, 96, 124, 168, 195, 224]
136+
Nemo.fmpz[1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, 60, 72, 91, 96, 124, 168, 195, 224]
137137
138138
Iterate over the record values of sigma the indices of which do not exceed 20.
139-
0, 1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, ...
139+
1, 3, 4, 7, 12, 15, 18, 28, 31, 39, 42, ...
140140
141141
Return the 9-th record of sigma.
142142
9 -> 28

0 commit comments

Comments
 (0)