Help Reserved Variable Names: C 2018 Karim Belabas. Permissions On Back. v2.35
Help Reserved Variable Names: C 2018 Karim Belabas. Permissions On Back. v2.35
c 2018 Karim Belabas. Permissions on back. v2.35
Elementary Arithmetic Functions Miscellaneous Rectwindow functions
vector of binary digits of |x| binary(x) integer square / n-th root of x sqrtint(x), sqrtnint(x, n) init window w, with size x,y plotinit(w, x, y)
bit number n of integer x bittest(x, n) largest integer e s.t. be ≤ b, e = blogb (x)c logint(x, b, {&z}) erase window w plotkill(w)
Hamming weight of integer x hammingweight(x) CRT: solve z ≡ x and z ≡ y chinese(x, y) copy w to w2 with offset (dx, dy) plotcopy(w, w2 , dx, dy)
digits of integer x in base B digits(x, {B = 10}) minimal u, v so xu + yv = gcd(x, y) gcdext(x, y) clips contents of w plotclip(w)
sum of digits of integer x in base B sumdigits(x, {B = 10}) continued fraction of x contfrac(x, {b}, {lmax}) scale coordinates in w plotscale(w, x1 , x2 , y1 , y2 )
integer from digits fromdigits(v, {B = 10}) last convergent of continued fraction x contfracpnqn(x) ploth in w plotrecth(w, X = a, b, expr, {flag}, {n})
ceiling/floor/fractional part ceil, floor, frac rational approximation to x (den. ≤ B) bestappr(x, {B}k) plothraw in w plotrecthraw(w, data, {flag})
round x to nearest integer round(x, {&e}) recognize x ∈ C as polmod mod T ∈ Z[X] bestapprnf(x, T ) draw window w1 at (x1 , y1 ), . . . plotdraw([[w1 , x1 , y1 ], . . .])
truncate x truncate(x, {&e}) Characters Low-level Rectwindow Functions
gcd/LCM of x and y gcd(x, y), lcm(x, y) set current drawing color in w to c plotcolor(w, c)
Let cyc = [d1 , . . . , dk ] represent an abelian group G = ⊕(Z/dj Z) ·
gcd of entries of a vector/matrix content(x) current position of cursor in w plotcursor(w)
gj or any structure G affording a .cyc method; e.g. znstar(q, 1)
Primes and Factorization write s at cursor’s position plotstring(w, s)
for Dirichlet characters. A character χ is coded by [c1 , . . . , ck ] such
extra prime table addprimes() move cursor to (x, y) plotmove(w, x, y)
that χ(gj ) = e(nj /dj ).
add primes in v to prime table addprimes(v) move cursor to (x + dx, y + dy) plotrmove(w, dx, dy)
χ · ψ; χ−1 ; χ · ψ −1 ; χk charmul, charconj, chardiv,, charpow draw a box to (x2 , y2 ) plotbox(w, x2 , y2 )
remove primes from prime table removeprimes(v)
order of χ charorder(cyc, χ) draw a box to (x + dx, y + dy) plotrbox(w, dx, dy)
Chebyshev π(x), n-th prime pn primepi(x), prime(n)
kernel of χ charker(cyc, χ) draw polygon plotlines(w, lx, ly, {flag})
vector of first n primes primes(n)
χ(x), G a GP group structure chareval(G, χ, x, {z}) draw points plotpoints(w, lx, ly)
smallest prime ≥ x nextprime(x)
Galois orbits of characters chargalois(G) draw line to (x + dx, y + dy) plotrline(w, dx, dy)
largest prime ≤ x precprime(x)
Dirichlet Characters draw point (x + dx, y + dy) plotrpoint(w, dx, dy)
factorization of x factor(x, {lim})
. . . selecting specific algorithms factorint(x, {flag = 0}) initialize G = (Z/qZ)∗ G = znstar(q, 1) draw point (x + dx, y + dy) plotrpoint(w, dx, dy)
n = df 2 , d squarefree/fundamental core(n, {f l}), coredisc convert datum D to [G, χ] znchar(D) Convert to Postscript or Scalable Vector Graphics
certificate for (prime) N primecert(N ) is χ odd? zncharisodd(G, χ) The format f is either "ps" or "svg".
verifies a certificate c primecertisvalid(c) real χ → Kronecker symbol (D/.) znchartokronecker(G, χ) as ploth plothexport(f, X = a, b, expr, {flag}, {n})
convert certificate to Magma/PRIMO primecertexport conductor of χ zncharconductor(G, χ) as plothraw plothrawexport(f, lx, ly, {flag})
recover x from its factorization factorback(f, {e}) [G0 , χ0 ] primitive attached to χ znchartoprimitive(G, χ) as plotdraw plotexport(f,[[w1 , x1 , y1 ], . . .])
x ∈ Z, |x| ≤ X, gcd(N, P (x)) ≥ N zncoppersmith(P, N, X, {B}) induce χ ∈ Ĝ to Z/N Z zncharinduce(G, χ, N )
divisors of N in residue class r mod s divisorslenstra(N, r, s) χ
Q p znchardecompose(G, χ, p)
Divisors and multiplicative functions p|(Q,N ) χp znchardecompose(G, χ, Q)
number of prime divisors ω(n) / Ω(n) omega(n), bigomega complex Gauss sum Ga (χ) znchargauss(G, χ)
divisors of n / number of divisors τ (n) divisors(n), numdiv Conrey labelling
sum of (k-th powers of) divisors of n sigma(n, {k}) Conrey label m ∈ (Z/qZ)∗ → character znconreychar(G, m)
Möbius µ-function moebius(x) character → Conrey label znconreyexp(G, χ)
Ramanujan’s τ -function ramanujantau(x) log on Conrey generators znconreylog(G, m)
Combinatorics conductor of χ (χ0 primitive) znconreyconductor(G, χ, {χ0 })
factorial of x x! or factorial(x) True-False Tests
binomial coefficient x
k binomial(x, {k}) is x the disc. of a quadratic field? isfundamental(x)
Bernoulli number Bn as real/rational bernreal(n), bernfrac is x a prime? isprime(x)
Bernoulli polynomial Bn (x) bernpol(n, {x}) is x a strong pseudo-prime? ispseudoprime(x)
n-th Fibonacci number fibonacci(n) is x square-free? issquarefree(x)
Stirling numbers s(n, k) and S(n, k) stirling(n, k, {flag}) is x a square? issquare(x, {&n})
number of partitions of n numbpart(n) is x a perfect power? ispower(x, {k}, {&n})
k-th permutation on n letters numtoperm(n, k) is x a perfect power of a prime? (x = pn ) isprimepower(x, &n})
convert permutation to (n, k) form permtonum(v) . . . of a pseudoprime? ispseudoprimepower(x, &n})
order of permutation p permorder(p) is x powerful? ispowerful(x) Based on an earlier version by Joseph H. Silverman
signature of permutation p permsign(p) is x a totient? (x = ϕ(n)) istotient(x, {&n}) July 2018 v2.35. Copyright
c 2018 K. Belabas
Multiplicative groups (Z/N Z)∗ , F∗ q is x a polygonal number? (x = P (s, n)) ispolygonal(x, s, {&n}) Permission is granted to make and distribute copies of this card provided the
Euler φ-function eulerphi(x) copyright and this permission notice are preserved on all copies.
is pol irreducible? polisirreducible(pol)
multiplicative order of x (divides o) znorder(x, {o}), fforder Send comments and corrections to [email protected]