Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
func jacobi(n, k) {
assert(k > 0, "#{k} must be positive")
assert(k.is_odd, "#{k} must be odd")
var t = 1
while (n %= k) {
var v = n.valuation(2)
t *= (-1)**v if (k%8 ~~ [3,5])
n >>= v
(n,k) = (k,n)
t = -t if ([n%4, k%4] == [3,3])
}
k==1 ? t : 0
}
for n in (0..50), k in (0..50) {
assert_eq(jacobi(n, 2*k + 1), kronecker(n, 2*k + 1))
}