-
Notifications
You must be signed in to change notification settings - Fork 0
/
wilson-gauss-trifactorial.sf
102 lines (70 loc) · 2.41 KB
/
wilson-gauss-trifactorial.sf
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
#!/usr/bin/ruby
#~ func gauss(m) {
#~ prod(1..m, {|k|
#~ if (gcd(k, m) == 1) {
#~ k
#~ }
#~ else {
#~ 1
#~ }
#~ })
#~ }
#~ say gauss(13**2)
#~ var p = 43
#~ var t = mfactorial(3*p + kronecker(p, 3), 3)
#~ var g = gcd(t, gauss(p**2))
#~ say t/g
#~ __END__
#~ for p in (4..1e6) {
#~ #if ((2*k - 1)!! % k**2 - k**2 == -k) {
#~ #if (mfactorial(3*p - kronecker(p, 3), 3) % p**2 - p**2 / 2 == -p) {
#~ if (mfactorial(3*p + kronecker(p, 3), 3) -> is_congruent(-p, p**2)) {
#~ say p
#~ if (!p.is_prime) {
#~ die "Counter-example: #{p}"
#~ }
#~ }
#~ elsif (p.is_prime) {
#~ die "Missed a prime: #{p}"
#~ }
#~ }
# (3*k + kronecker(k, 3)) (-3)^floor(((3*k + kronecker(k, 3)) - 1)/3) (1 - (3*k + kronecker(k, 3))/3)_floor(((3*k + kronecker(k, 3)) - 1)/3)
#~ for k in (primes(2, 43)) {
#~ say [k,
#~ (k-1)! % k,
#~ mfactorial(3*k + kronecker(k, 3), 3) % k**2 / k,
#~ #mfactorial(3*k - 2*kronecker(k, 3), 3) % k**2 / k,
#~ var t = (mfactorial(3*(k+1) - 1, 3) % k**2)
#~ t.is_congruent(k, k**2)
#~ #mfactorial(3*k + kronecker(k, 3), 3) % k**2 / k,
#~ #k! % k**2 / k
#~ ]
#~ }
#~ __END__
for p in (primes(2, 100)) {
#for p in (3..10) {
#~ say [
#~ p, mfactorial(3*p - kronecker(p, 3), 3) % p**2 - p**2 / 2 ,
#~ mfactorial(3*p - kronecker(p, 3), 3) -> is_congruent(-2*p, p**2)
#~ ]
say [
p, mfactorial(3*p + kronecker(p, 3), 3) % p**2 - p**2,
mfactorial(3*p + kronecker(p, 3), 3) -> is_congruent(-p, p**2)
]
#~ say [
#~ p, mfactorial(3*p + kronecker(p, 3), 3) % p**2 / p,
#~ #mfactorial(3*p + kronecker(p, 3), 3) -> is_congruent(-p, p**2)
#~ ]
#~ say [
#~ p, mfactorial(3*p - kronecker(p, 5), 1) % p**3 / p
#~ ]
#say [p, mfactorial(3*p - kronecker(p, 3), 3) ]
#say [p, mfactorial(3*p - 3, 3) % p**2 ]
}
__END__
#For p > 2, (2p-1)!! == -p (mod p^2) if and only if p is prime.
Hi,
The following statement should also be provable:
For p > 3, f_3(3p + (p/3)) == -p (mod p^2) if and only if p is prime.
where (p/3) is the Jacobi symbol and f_3(n) are the triple factorial numbers: f_3(n) = A007661(n).
#~ By Wilson's theorem, ((p - 1)/2)!^2 == (-1)^((p + 1)/2) (mod p) for each prime number p. Hence, if p == 3 (mod 4), then ((p - 1)/2)! == +-1 (mod p).