LCM: Lectures on Computational Mathematics

Total Page:16

File Type:pdf, Size:1020Kb

LCM: Lectures on Computational Mathematics LCM: Lectures on Computational Mathematics Przemysław Koprowski Septempber 10, 2015 – April 25, 2021 These notes were compiled on April 25, 2021. Since I update the notes quite frequently, it is possible that a newer version is already available. Please check on: http://www.pkoprowski.eu/lcm 1 Contents Contents 3 1 Fundamental algorithms 9 1.1 Integers and univariate polynomials . 9 1.2 Floating point numbers . 33 1.3 Euclidean algorithm . 38 1.4 Rational numbers and rational functions . 57 1.5 Multivariate polynomials . 58 1.6 Transcendental constants . 58 1.A Scaled Bernstein polynomials . 58 2 Modular arithmetic 79 2.1 Basic modular arithmetic . 79 2.2 Chinese remainder theorem . 82 2.3 Modular exponentiation . 87 2.4 Modular square roots . 92 2.5 Applications of modular arithmetic . 109 3 Matrices 115 3.1 Matrix arithmetic . 115 3.2 Gauss elimination . 118 3.3 Matrix decomposition . 126 3.4 Determinant . 126 3.5 Systems of linear equations . 147 3.6 Eigenvalues and eigenvectors . 147 3.7 Short vectors . 155 3.8 Special matrices . 168 4 Contents 4 Reconstruction and interpolation 175 4.1 Polynomial interpolation . 175 4.2 Runge’s phenomenon and Chebyshev nodes . 187 4.3 Piecewise polynomial interpolation . 193 4.4 Fourier transform and fast multiplication . 194 5 Factorization and irreducibility tests 205 5.1 Primality tests . 206 5.2 Integer factorization . 215 5.3 Square-free decomposition of polynomials . 216 5.4 Applications of square-free decomposition . 227 5.5 Polynomial factorization over finite fields . 232 5.6 Polynomial factorization over rationals . 237 6 Univariate polynomial equations 239 6.1 Generalities . 239 6.2 Explicit formulæ for low degree polynomials . 242 6.3 Bounds on roots . 246 6.4 Distances between roots . 264 6.5 Root counting and isolating . 268 6.6 Root approximation . 286 6.7 Higher degree solvable polynomials . 305 6.8 Strategies for solving univariate polynomial equations . 305 6.9 Thom’s lemma . 305 7 Integration 309 7.1 Symbolic integration of rational functions . 309 7.2 Classical numeric integration schemes . 312 7.3 Monte Carlo integration . 312 8 Classical elimination theory 313 8.1 Labatie–Kalkbrener triangulation . 315 8.2 Resultant . 327 8.3 Applications of resultants . 358 8.4 Subresultants . 375 9 Gröbner bases 381 9.1 Algebraic prerequisites . 381 9.2 Monomial orders . 383 9.3 Gauss elimination revisited . 385 9.4 Multivariate polynomial reduction . 386 9.5 Gröbner bases . 389 9.6 Buchberger’s criterion . 390 9.7 Minimal and reduced Gröbner bases . 392 Notes homepage: http://www.pkoprowski.eu/lcm Contents 5 9.8 Elimination of variables . 394 10 Zero-dimensional polynomial systems 399 A Fundamental concepts from algebra 401 Bibliography 403 Built: April 25, 2021 Introduction Witchcraft to the ignorant,. simple science to the learned. “The Sorcerer of Rhiannon”, L. Brackett Computational mathematics is the least common multiple of mathematics and al- gorithms. This is a ‘work-in-progress’ version of lecture notes to “Introduction to com- putational mathematics” and “Computational mathematics” courses. Terry Pratchett in his novel “Interesting times” says that “Magic isn’t like maths”. Assuming symmetry of the relation, this implies that mathematics is not like magic, either. Even if they both begin with ‘ma’. They both provide their adepts with some tools to perform certain actions: spells in the case of magic and theorem in mathemat- ics. The difference is that in mathematics one knows why and how a given tool works. One may read a proof of the theorem and verify its correctness. A mathematician can check how assumptions of the theorem are used and what would happen if they were omitted. On the contrary, in magic (as far as I understand) a wizard casts a spell to obtain the desired result but he does not know why and how the spell works, which ingredients of the spell are important and what would happen if he said ‘dabraabraca’ instead of ‘abracadabra’. Nowadays, there are many mathematically oriented computer programs (co-called Computer Algebra Systems or CASs for short). Some of them are paid. Some are free. Unfortunately, many users treat them like oracles. Without understanding the princi- ples of how these systems works, using them is more magic than mathematics. Issuing a command like (x^6 - 5*x^4 + 4*x^2 - x).roots() is not very different from casting a spell, when one doesn’t understand what a system can or cannot do with an unsolvable polynomial (and what it really means that a 8 Contents polynomial is unsolvable). Thus, the aim of these notes is to explain mathematics that operates behind the scene in computer algebra systems. To show that there is really no magic in them. Notes homepage: http://www.pkoprowski.eu/lcm 1 Fundamental algorithms A journey of a thousand miles begins with a single step. “Tao Te Ching”, Laozi This chapter is devoted to introducing representations of the most elementary math- ematical objects, together with accompanying fundamental algorithm, like standard arithmetic operations. These fundamentals seem to be often neglected, but they are indispensable for developing “more serious” algorithms, as they form the basic build- ing blocks of the latter ones. Moreover, these basic arithmetic operations, although shyly hidden inside the big algorithms, are executed over and over again. Thus, their speed have a major impact on the overall performance of their bigger brothers. For foundations of mathematics the most fundamental objects are sets. In the realm of computational mathematics the elementary objects are integers (for symbolic com- putations) and floating-point numbers (for numerical methods). Hence, these two types of objects will be are main subject in the next sections. Moreover, since univari- ate polynomials are very like integers (and algorithms designed for polynomials are usually a little bit simpler) we discuss integers and polynomials together. 1.1 Integers and univariate polynomials Integers and polynomials exhibit lots of similarities from algebraic and algorithmic points of view. On the algebraic side, the ring of integers and the ring of univariate polynomials (over a field) are both Euclidean domains. From the algorithmic point of view, integers and polynomials are just finite sequences of digits and coefficients, respectively. An integer n Z is represented by a signed, finite sequence of digits 2 (nk nk 1 ... n0)β such that ± − k n = nkβ + + n1β + n0 , ± ··· 10 Chapter 1. Fundamental algorithms where the integer β 2 is a fixed base of the representation and every digit ni is an element of the set 0,≥ . , β 1 . For example, let n be a number one hundred ninety- seven thousand six hundredf forty-one− g , then at base ten, the number n is represented by a 6-tuple (197641)10, since 5 4 3 2 1 n = 1 10 + 9 10 + 7 10 + 6 10 + 4 10 + 1. · · · · · On the other hand, the same number is represented as (110000010000001001)2 at base 2 and as (349)256 at base 256. The choice of the base is quite arbitrary. As human beings we are used to the base 10, but the only reason for it is that we have a total of ten fingers on both hands. For computers a more natural choice is a power of 2. The base 2 is used mostly at the lowest, hardware level (in this case there are also some other representations in use, like for instance two’s-complement notation, which we will not discuss in these notes). While at higher levels of abstraction, say in computer algebra systems, the base β is commonly chosen in such a way that a single digit fits into a single memory slot. So for example, at base 256 the digits are stored as bytes, at base 65 536 as 16-bit words. and so on. Here we will not place any restrictions on the base nor on the length of an integer, understood as the number of digits. We will always assume that we are able to store as many digits as we need. Like integers, univariate polynomials are represented as finite sequences. Let R be a (fixed) ring of coefficients. Assume that we have means to represent elements of R and to operate on them. The simplest and most common approach is to represent a polynomial f R[x] as a sequence of its coefficients (fn,..., f1, f0), where f = n 2 fn x + + f1 x + f0. This is called the power basis representation of f , since f0,..., fn are nothing··· else but the coordinates of f with respect to the basis 1, x,..., x k,... of the free R-module R[x]. This is not the only possible representationf of a polynomialg and later we will discuss scaled Bernstein-basis representation (see Appendix 1.A). n Let f = fn x + + f1 x + f0 be a nonzero polynomial. The maximal index k ··· such that fk = 0 is called the degree of f and denoted deg f . The degree of the zero polynomial is6 defined to be . It will be often convenient to allow the coefficients of f to be defined for all integer−∞ indices, with the convention that f j 0 whenever j < 0 or j > deg f . Formally speaking, we view polynomials as infinite≡ sequences indexed by elements of Z with only finitely many nonzero entries. The set supp f := k Z fk = 0 of the indices of nonzero terms is called the support of f . In this fbook2 wej will6 sometimesg (see e.g. Section 6.3 of Chapter 6) encounter the notion of a reciprocal polynomial, that we now introduce. n n Definition 1.1.1. Let f = fn x + + f1 x + f0 be a polynomial. A polynomial f0 x + n 1 ··· + fn 1 x − + fn, obtained from f by reversing the order of coefficients, is called reciprocal··· − polynomial polynomial of f and denoted rev f .
Recommended publications
  • K-Quasiderivations
    K-QUASIDERIVATIONS CALEB EMMONS, MIKE KREBS, AND ANTHONY SHAHEEN Abstract. A K-quasiderivation is a map which satisfies both the Product Rule and the Chain Rule. In this paper, we discuss sev- eral interesting families of K-quasiderivations. We first classify all K-quasiderivations on the ring of polynomials in one variable over an arbitrary commutative ring R with unity, thereby extend- ing a previous result. In particular, we show that any such K- quasiderivation must be linear over R. We then discuss two previ- ously undiscovered collections of (mostly) nonlinear K-quasiderivations on the set of functions defined on some subset of a field. Over the reals, our constructions yield a one-parameter family of K- quasiderivations which includes the ordinary derivative as a special case. 1. Introduction In the middle half of the twientieth century|perhaps as a reflection of the mathematical zeitgeist|Lausch, Menger, M¨uller,N¨obauerand others formulated a general axiomatic framework for the concept of the derivative. Their starting point was (usually) a composition ring, by which is meant a commutative ring R with an additional operation ◦ subject to the restrictions (f + g) ◦ h = (f ◦ h) + (g ◦ h), (f · g) ◦ h = (f ◦ h) · (g ◦ h), and (f ◦ g) ◦ h = f ◦ (g ◦ h) for all f; g; h 2 R. (See [1].) In M¨uller'sparlance [9], a K-derivation is a map D from a composition ring to itself such that D satisfies Additivity: D(f + g) = D(f) + D(g) (1) Product Rule: D(f · g) = f · D(g) + g · D(f) (2) Chain Rule D(f ◦ g) = [(D(f)) ◦ g] · D(g) (3) 2000 Mathematics Subject Classification.
    [Show full text]
  • Can the Arithmetic Derivative Be Defined on a Non-Unique Factorization Domain?
    1 2 Journal of Integer Sequences, Vol. 16 (2013), 3 Article 13.1.2 47 6 23 11 Can the Arithmetic Derivative be Defined on a Non-Unique Factorization Domain? Pentti Haukkanen, Mika Mattila, and Jorma K. Merikoski School of Information Sciences FI-33014 University of Tampere Finland [email protected] [email protected] [email protected] Timo Tossavainen School of Applied Educational Science and Teacher Education University of Eastern Finland P.O. Box 86 FI-57101 Savonlinna Finland [email protected] Abstract Given n Z, its arithmetic derivative n′ is defined as follows: (i) 0′ = 1′ =( 1)′ = ∈ − 0. (ii) If n = up1 pk, where u = 1 and p1,...,pk are primes (some of them possibly ··· ± equal), then k k ′ 1 n = n = u p1 pj−1pj+1 pk. X p X ··· ··· j=1 j j=1 An analogous definition can be given in any unique factorization domain. What about the converse? Can the arithmetic derivative be (well-)defined on a non-unique fac- torization domain? In the general case, this remains to be seen, but we answer the question negatively for the integers of certain quadratic fields. We also give a sufficient condition under which the answer is negative. 1 1 The arithmetic derivative Let n Z. Its arithmetic derivative n′ (A003415 in [4]) is defined [1, 6] as follows: ∈ (i) 0′ =1′ =( 1)′ = 0. − (ii) If n = up1 pk, where u = 1 and p1,...,pk P, the set of primes, (some of them possibly equal),··· then ± ∈ k k ′ 1 n = n = u p1 pj−1pj+1 pk.
    [Show full text]
  • Dirichlet Product of Derivative Arithmetic with an Arithmetic Function Multiplicative a PREPRINT
    DIRICHLET PRODUCT OF DERIVATIVE ARITHMETIC WITH AN ARITHMETIC FUNCTION MULTIPLICATIVE A PREPRINT Es-said En-naoui [email protected] August 21, 2019 ABSTRACT We define the derivative of an integer to be the map sending every prime to 1 and satisfying the Leibniz rule. The aim of this article is to calculate the Dirichlet product of this map with a function arithmetic multiplicative. 1 Introduction Barbeau [1] defined the arithmetic derivative as the function δ : N → N , defined by the rules : 1. δ(p)=1 for any prime p ∈ P := {2, 3, 5, 7,...,pi,...}. 2. δ(ab)= δ(a)b + aδ(b) for any a,b ∈ N (the Leibnitz rule) . s αi Let n a positive integer , if n = i=1 pi is the prime factorization of n, then the formula for computing the arithmetic derivative of n is (see, e.g., [1, 3])Q giving by : s α α δ(n)= n i = n (1) pi p Xi=1 pXα||n A brief summary on the history of arithmetic derivative and its generalizations to other number sets can be found, e.g., in [4] . arXiv:1908.07345v1 [math.GM] 15 Aug 2019 First of all, to cultivate analytic number theory one must acquire a considerable skill for operating with arithmetic functions. We begin with a few elementary considerations. Definition 1 (arithmetic function). An arithmetic function is a function f : N −→ C with domain of definition the set of natural numbers N and range a subset of the set of complex numbers C. Definition 2 (multiplicative function). A function f is called an multiplicative function if and only if : f(nm)= f(n)f(m) (2) for every pair of coprime integers n,m.
    [Show full text]
  • Download This PDF File
    International Journal of Electrical and Computer Engineering (IJECE) Vol. 10, No. 2, April 2020, pp. 1469~1476 ISSN: 2088-8708, DOI: 10.11591/ijece.v10i2.pp1469-1476 1469 The new integer factorization algorithm based on fermat’s factorization algorithm and euler’s theorem Kritsanapong Somsuk Department of Computer and Communication Engineering, Faculty of Technology, Udon Thani Rajabhat University, Udon Thani, 41000, Thailand Article Info ABSTRACT Article history: Although, Integer Factorization is one of the hard problems to break RSA, many factoring techniques are still developed. Fermat’s Factorization Received Apr 7, 2019 Algorithm (FFA) which has very high performance when prime factors are Revised Oct 7, 2019 close to each other is a type of integer factorization algorithms. In fact, there Accepted Oct 20, 2019 are two ways to implement FFA. The first is called FFA-1, it is a process to find the integer from square root computing. Because this operation takes high computation cost, it consumes high computation time to find the result. Keywords: The other method is called FFA-2 which is the different technique to find prime factors. Although the computation loops are quite large, there is no Computation loops square root computing included into the computation. In this paper, Euler’s theorem the new efficient factorization algorithm is introduced. Euler’s theorem is Fermat’s factorization chosen to apply with FFA to find the addition result between two prime Integer factorization factors. The advantage of the proposed method is that almost of square root Prime factors operations are left out from the computation while loops are not increased, they are equal to the first method.
    [Show full text]
  • Combinatorial Species and Labelled Structures Brent Yorgey University of Pennsylvania, [email protected]
    University of Pennsylvania ScholarlyCommons Publicly Accessible Penn Dissertations 1-1-2014 Combinatorial Species and Labelled Structures Brent Yorgey University of Pennsylvania, [email protected] Follow this and additional works at: http://repository.upenn.edu/edissertations Part of the Computer Sciences Commons, and the Mathematics Commons Recommended Citation Yorgey, Brent, "Combinatorial Species and Labelled Structures" (2014). Publicly Accessible Penn Dissertations. 1512. http://repository.upenn.edu/edissertations/1512 This paper is posted at ScholarlyCommons. http://repository.upenn.edu/edissertations/1512 For more information, please contact [email protected]. Combinatorial Species and Labelled Structures Abstract The theory of combinatorial species was developed in the 1980s as part of the mathematical subfield of enumerative combinatorics, unifying and putting on a firmer theoretical basis a collection of techniques centered around generating functions. The theory of algebraic data types was developed, around the same time, in functional programming languages such as Hope and Miranda, and is still used today in languages such as Haskell, the ML family, and Scala. Despite their disparate origins, the two theories have striking similarities. In particular, both constitute algebraic frameworks in which to construct structures of interest. Though the similarity has not gone unnoticed, a link between combinatorial species and algebraic data types has never been systematically explored. This dissertation lays the theoretical groundwork for a precise—and, hopefully, useful—bridge bewteen the two theories. One of the key contributions is to port the theory of species from a classical, untyped set theory to a constructive type theory. This porting process is nontrivial, and involves fundamental issues related to equality and finiteness; the recently developed homotopy type theory is put to good use formalizing these issues in a satisfactory way.
    [Show full text]
  • Modern Computer Arithmetic (Version 0.5. 1)
    Modern Computer Arithmetic Richard P. Brent and Paul Zimmermann Version 0.5.1 arXiv:1004.4710v1 [cs.DS] 27 Apr 2010 Copyright c 2003-2010 Richard P. Brent and Paul Zimmermann This electronic version is distributed under the terms and conditions of the Creative Commons license “Attribution-Noncommercial-No Derivative Works 3.0”. You are free to copy, distribute and transmit this book under the following conditions: Attribution. You must attribute the work in the manner specified • by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Noncommercial. You may not use this work for commercial purposes. • No Derivative Works. You may not alter, transform, or build upon • this work. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the web page below. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author’s moral rights. For more information about the license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ Contents Contents iii Preface ix Acknowledgements xi Notation xiii 1 Integer Arithmetic 1 1.1 RepresentationandNotations . 1 1.2 AdditionandSubtraction . .. 2 1.3 Multiplication . 3 1.3.1 Naive Multiplication . 4 1.3.2 Karatsuba’s Algorithm . 5 1.3.3 Toom-Cook Multiplication . 7 1.3.4 UseoftheFastFourierTransform(FFT) . 8 1.3.5 Unbalanced Multiplication . 9 1.3.6 Squaring.......................... 12 1.3.7 Multiplication by a Constant .
    [Show full text]
  • User's Guide to PARI / GP
    User’s Guide to PARI / GP C. Batut, K. Belabas, D. Bernardi, H. Cohen, M. Olivier Laboratoire A2X, U.M.R. 9936 du C.N.R.S. Universit´eBordeaux I, 351 Cours de la Lib´eration 33405 TALENCE Cedex, FRANCE e-mail: [email protected] Home Page: http://pari.math.u-bordeaux.fr/ Primary ftp site: ftp://pari.math.u-bordeaux.fr/pub/pari/ last updated 11 December 2003 for version 2.2.7 Copyright c 2000–2003 The PARI Group ° Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions, or translations, of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. PARI/GP is Copyright c 2000–2003 The PARI Group ° PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Table of Contents Chapter1: OverviewofthePARIsystem . ...........5 1.1Introduction ..................................... ....... 5 1.2ThePARItypes..................................... ...... 6 1.3Operationsandfunctions. ...........9 Chapter 2: Specific Use of the GP Calculator . ............ 13 2.1Defaultsandoutputformats . ............14 2.2Simplemetacommands. ........21 2.3InputformatsforthePARItypes . .............25 2.4GPoperators ....................................... .28 2.5ThegeneralGPinputline . ........31 2.6 The GP/PARI programming language . .............32 2.7Errorsanderrorrecovery. .........42 2.8 Interfacing GP with other languages .
    [Show full text]
  • Improved Arithmetic in the Ideal Class Group of Imaginary Quadratic Number Fields with an Application to Integer Factoring
    University of Calgary PRISM: University of Calgary's Digital Repository Graduate Studies The Vault: Electronic Theses and Dissertations 2013-06-14 Improved Arithmetic in the Ideal Class Group of Imaginary Quadratic Number Fields with an Application to Integer Factoring Sayles, Maxwell Sayles, M. (2013). Improved Arithmetic in the Ideal Class Group of Imaginary Quadratic Number Fields with an Application to Integer Factoring (Unpublished master's thesis). University of Calgary, Calgary, AB. doi:10.11575/PRISM/26473 http://hdl.handle.net/11023/752 master thesis University of Calgary graduate students retain copyright ownership and moral rights for their thesis. You may use this material in any way that is permitted by the Copyright Act or through licensing that has been assigned to the document. For uses that are not allowable under copyright legislation or licensing, you are required to seek permission. Downloaded from PRISM: https://prism.ucalgary.ca UNIVERSITY OF CALGARY Improved Arithmetic in the Ideal Class Group of Imaginary Quadratic Number Fields With an Application to Integer Factoring by Maxwell Sayles A THESIS SUBMITTED TO THE FACULTY OF GRADUATE STUDIES IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE DEPARTMENT OF COMPUTER SCIENCE CALGARY, ALBERTA May, 2013 c Maxwell Sayles 2013 Abstract This thesis proposes practical improvements to arithmetic and exponentiation in the ideal class group of imaginary quadratic number fields for the Intel x64 architecture. This is useful in tabulating the class number and class group structure, but also as an application to a novel integer factoring algorithm called \SuperSPAR". SuperSPAR builds upon SPAR using an idea from Sutherland, namely a bounded primorial steps search, as well as by using optimized double-based representations of exponents, and general improvements to arithmetic in the ideal class group.
    [Show full text]
  • Arithmetic Subderivatives and Leibniz-Additive Functions
    Arithmetic Subderivatives and Leibniz-Additive Functions Jorma K. Merikoski, Pentti Haukkanen Faculty of Information Technology and Communication Sciences, FI-33014 Tampere University, Finland jorma.merikoski@uta.fi, pentti.haukkanen@tuni.fi Timo Tossavainen Department of Arts, Communication and Education, Lulea University of Technology, SE-97187 Lulea, Sweden [email protected] Abstract We first introduce the arithmetic subderivative of a positive inte- ger with respect to a non-empty set of primes. This notion generalizes the concepts of the arithmetic derivative and arithmetic partial deriva- tive. More generally, we then define that an arithmetic function f is Leibniz-additive if there is a nonzero-valued and completely multi- plicative function hf satisfying f(mn)= f(m)hf (n)+ f(n)hf (m) for all positive integers m and n. We study some basic properties of such functions. For example, we present conditions when an arithmetic function is Leibniz-additive and, generalizing well-known bounds for the arithmetic derivative, establish bounds for a Leibniz-additive func- tion. arXiv:1901.02216v1 [math.NT] 8 Jan 2019 1 Introduction We let P, Z+, N, Z, and Q stand for the set of primes, positive integers, nonnegative integers, integers, and rational numbers, respectively. Let n ∈ Z+. There is a unique sequence (νp(n))p∈P of nonnegative integers (with only finitely many positive terms) such that n = pνp(n). (1) Y p∈P 1 We use this notation throughout. Let ∅= 6 S ⊆ P. We define the arithmetic subderivative of n with respect to S as ν (n) D (n)= n′ = n p . S S X p p∈S ′ In particular, nP is the arithmetic derivative of n, defined by Barbeau [1] and studied further by Ufnarovski and Ahlander˚ [6].
    [Show full text]
  • User's Guide to Pari/GP
    User's Guide to PARI / GP (version 2.7.0) The PARI Group Institut de Math´ematiquesde Bordeaux, UMR 5251 du CNRS. Universit´eBordeaux 1, 351 Cours de la Lib´eration F-33405 TALENCE Cedex, FRANCE e-mail: [email protected] Home Page: http://pari.math.u-bordeaux.fr/ Copyright c 2000{2014 The PARI Group Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions, or translations, of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. PARI/GP is Copyright c 2000{2014 The PARI Group PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Table of Contents Chapter 1: Overview of the PARI system . 5 1.1 Introduction . 5 1.2 Multiprecision kernels / Portability . 6 1.3 The PARI types . 7 1.4 The PARI philosophy . 9 1.5 Operations and functions . 10 Chapter 2: The gp Calculator . 13 2.1 Introduction . 13 2.2 The general gp input line . 15 2.3 The PARI types . 17 2.4 GP operators . 27 2.5 Variables and symbolic expressions . 31 2.6 Variables and Scope . 34 2.7 User defined functions .
    [Show full text]
  • Canonical Form of Modular Hyperbolas with an Application to Integer
    Canonical form of modular hyperbolas with an application to integer factorization Juan Di Mauro1,2 1CONICET 2ICC-University of Buenos Aires [email protected] Abstract For a composite n and an odd c with c not dividing n, the number of solutions to the equation n + a ≡ b mod c with a,b quadratic residues modulus c is calculated. We establish a direct relation with those mod- ular solutions and the distances between points of a modular hyperbola. Furthermore, for certain composite moduli c, an asymptotic formula for quotients between the number of solutions and c is provided. Finally, an algorithm for integer factorization using such solutions is presented. Keywords— Modular Hyperbolas, Integer Factorization, Diophantine Equations 1 Introduction For n ∈ Z and p an odd prime, the set of integers Hn,p = {(x,y) | xy ≡ n mod p, 0 ≤ x,y <p} defines a modular hyperbola of n modulus p. If p and n are coprimes, the set Hn,p has φ(p)= p − 1 points. The above definition can be naturally extended to composite c and the set Hn,c. Regarding Hn,c as a subset of the Euclidean plane, the set of distances between points in the hyperbola is Dn,c = {|x − y| | x,y ∈ Hn,c} It is therefore not surprising to see that the set of distances and the set of solutions to the equation 2 n + a ≡ b mod c a,b ∈ Zc ∪ {0} (1) are related. The latter form, however, can be seen as more convenient for some appli- arXiv:2001.09814v2 [math.NT] 15 Apr 2020 cations, as shown in section 4.
    [Show full text]
  • Pipelined Implementation of a Fixed-Point Square Root Core Using Non-Restoring and Restoring Algorithm
    Rochester Institute of Technology RIT Scholar Works Theses 6-2017 Pipelined Implementation of a Fixed-Point Square Root Core Using Non-Restoring and Restoring Algorithm Vyoma Sharma [email protected] Follow this and additional works at: https://scholarworks.rit.edu/theses Recommended Citation Sharma, Vyoma, "Pipelined Implementation of a Fixed-Point Square Root Core Using Non-Restoring and Restoring Algorithm" (2017). Thesis. Rochester Institute of Technology. Accessed from This Master's Project is brought to you for free and open access by RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact [email protected]. PIPELINED IMPLEMENTATION OF A FIXED-POINT SQUARE ROOT CORE USING NON-RESTORING AND RESTORING ALGORITHM by Vyoma Sharma GRADUATE PAPER Submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE in Electrical Engineering Approved by: Mr. Mark A. Indovina, Lecturer Graduate Research Advisor, Department of Electrical and Microelectronic Engineering Dr. Sohail A. Dianat, Professor Department Head, Department of Electrical and Microelectronic Engineering DEPARTMENT OF ELECTRICAL AND MICROELECTRONIC ENGINEERING KATE GLEASON COLLEGE OF ENGINEERING ROCHESTER INSTITUTE OF TECHNOLOGY ROCHESTER,NEW YORK JUNE 2017 I dedicate this work to my family and friends for their love, support and inspiration during my thesis. Declaration I hereby declare that except where specific reference is made to the work of others, that all content of this Graduate Paper are original and have not been submitted in whole or in part for consideration for any other degree or qualification in this, or any other University.
    [Show full text]