FACTORIZATION USING SQUARE ROOT OF A SQUARE BINARY
QUADRATIC FORM
1
P Anuradha Kameswari 2K Vijaya Prasamsa
Department of Mathematics, Andhra University, Visakhapatnam- 530003, Andhra Pradesh, India.
.
ABSTRACT
The paper presents a method for factoring a composite integer π based on the composition of binary quadratic forms which depends on the search for ambiguous forms that leads to a non trivial factorization of π. In this method we propose to obtain a square binary quadratic form from a positive definite binary quadratic form and construct an ambiguous form via the square root of a square binary quadratic form.
KEYWORDS: Binary quadratic forms, Square binary quadratic forms, Discriminant, Factorization, Ambiguous forms.
1 Introduction
The theory of binary quadratic forms initiated right from ancient Greeks, developed by Brahma Gupta during seventh century, later by Lagrange, Gauss, Euler, Fermat during seventeenth century, plays a vital role in Computational Number Theory and Cryptography[1]. There are various factorization methods based on binary quadratic forms, Fermat factoring method based on binary quadratic forms representing a composite number π in two different ways by the binary quadratic form (1,0,1) or π₯2 + π¦2 and Mckee method speeds a Fermat algorithm. There are also factorizing methods based on composition of binary quadratic forms like Shankβs class group method by Shankβs during 1971 with complexity π(π
1
5+π) and Shankβs SQUFOF method
of complexity π(π
1
4+π) [2] and Schoofβs factoring algorithms by Schoof during 1982 with
complexity π(π
1
5). In addition to these, all seive factoring algorithms are based on solutions of the congruence of binary quadratic forms π₯2β π¦2 β‘ 0(modπ)[3]. In [4 ], we gave a factoring method, factorization via difference of squares using ambiguous forms. In this paper we describe a method based on composition of binary quadratic forms with discriminant π < 0. This method depends on the search for the ambiguous forms and we consider the positive definite square binary quadratic forms of the form ππ₯2 + ππ₯π¦ + ππ¦2 with π or π square and arrive at the required ambiguous form that leads a non trivial factorization of π. We first give a brief description on basics of binary quadratic forms, composition on binary quadratic forms, ambiguous forms and Shankβs class group factorization method.
International Research Journal of Mathematics, Engineering and IT Vol. 3, Issue 12, December 2016 Impact Factor- 5.489 ISSN: (2349-0322)
Β© Associated Asia Research Foundation (AARF)
1.1 Binary Quadratic Forms
A binary quadratic form π(π₯, π¦) is a homogeneous polynomial π(π₯, π¦) = ππ₯2+ ππ₯π¦ + ππ¦2 of degree 2 denoted by (π, π, π) where the coefficients π, π and π are fixed integers and the variables π₯ and π¦ are restricted to integers and by square binary quadratic form, we mean a binary quadratic form (π, π, π) where π is a square. A binary quadratic form (π, π, π) is said to be primitive if gcd(π, π, π) = 1 [5].
Definition 1 .1.1 The discriminant of a binary quadratic form π = (π, π, π) denoted as βdβ is defined to be the value π = π2β 4ππ.
Definition 1 .1.2 For π < 0, a binary quadratic form π(π₯, π¦) is said to be positive definite if
π > 0 and is negative definite if π < 0.
Definition 1 .1.3 For any ππβ€, π is set to be represented by the binary quadratic form π(π₯, π¦), if
π = π(π₯0, π¦0) for some π₯0, π¦0πβ€ and if gcd(π₯0, π¦0) = 1, it is called proper representation.
Definition 1 .1.4 Two binary quadratic forms π and π are equivalent [6] if there exists an integer matrix π = ππ ππ of determinant equal to 1 such that
π(π₯, π¦) = π( ππ ππ π₯π¦ ) = π(ππ₯ + ππ¦, ππ₯ + π π¦)
Theorem 1.1.5 Equivalence preserves the discriminant π = π2β 4ππ.
Remark 1.1.6 The equivalent relation of quadratic forms on the set of all binary quadratic forms of discriminant d is an equivalence relation and the equivalence classes can be classified by the binary quadratic forms called reduced forms.
For further study we consider only positive definite binary quadratic forms.
Definition 1.1.7 A positive definite quadratic form (π, π, π) is reduced if |π| β€ π β€ π and in addition, if either |π| = π or π = π, then π β₯ 0 [7].
The following theorem classify the equivalence classes by reduced forms.
Theorem 1.1.8 Every class of primitive positive definite quadratic forms contains a unique reduced form.
1.2 Composition on Binary quadratic forms [8]
Let π(π) denote the set of equivalence classes of primitive binary quadratic forms of discriminant π < 0. We shall use the notation < π, π, π > for the equivalence class containing the form (π, π, π). On the set π(π) given as π(π) = {< π, π, π >/πππ(π, π, π) = 1π€ππ‘ππ2β 4ππ = π} there is a binary operation βββ defined as follows:
for any, < π1, π1, π1 >, < π2, π2, π2 >β πΆ(π)
where (π3, π3, π3) is a binary quadratic form, obtained from the given quadratic forms (π1, π1, π1) , (π2, π2, π2) as
π3 = π1π2
π2 ,
π3 = π₯, the unique solution of π₯2 β‘ π(mod4π1π2 π2 ),
π₯ β‘ π1(mod2π1 π ),
π₯ β‘ π2(mod 2π2
π )
π3 = π2(π32βπ 4π1π2)
for π = gcd(π1, π2,π1+π2
2 ) . In particular, this form (π3, π3, π3) is also represented as
(π1, π1, π1) β (π2, π2, π2). With respect to this composition of gauss on π(π), π(π) forms an abelian group with < 1,0,βπ
4 > or < 1,1, 1βπ
4 > as identity accordingly as π even or odd respectively, and for any < π, π, π > in π(π), < π, π, π > is the inverse.
Definition 1.2.1 The order of the group π(π) is the number of primitive reduced forms called the class number and is denoted as π(π) [8].
Definition 1.2.2 The set of all classes in π(π) of order 2 are called the ambiguous classes [9].
Remark 1.2.3 The primitive reduced forms of the ambiguous classes called ambiguous forms are of three types namely (π, 0, π), (π, π, π) and (π, π, π) [10] and are classified by the following lemma.
Lemma 1.2.4 Suppose π is a negative discriminant. If π is even, then the ambiguous forms of discriminant π include the forms (π’, 0, π£), where 0 < π’ β€ π£, gcd(π’, π£) = 1, and π’π£ = βπ/4. In addition,if π’π£ = βπ/4, with gcd(π’, π£) = 1 or 2 and 1
2(π’ + π£) odd, we have the forms 1
2(π’ + π£), π£ β π’, 1
2(π’ + π£) when 1
3π£ β€ π’ < π£ and the forms (2π’, 2π’, 1
2(π’ + π£)) when 0 < π’ < 1
3π£. If π is odd, then the ambiguous forms of discriminant π are the forms ( 1
4(π’ + π£), 1 2(π£ β
π’),1
4(π’ + π£)), where βπ = π’π£ with 0 < 1
3π£ β€ π’ β€ π£, gcd(π’, π£) = 1 and the forms
(π’, π’,1
4(π’ + π£)), where βπ = π’π£, 0 < π’ β€ 1
3(π£), gcd(π’, π£) = 1.
Shankβs Class Group method of factorization : In this method, the above lemma on ambiguous form is used in implementing factorization method with ambiguous forms. In this method it is noted that each ambiguous form gives a factorization of π, the search for non trivial factorizations is really a search for ambiguous form. Given a negative discriminant π, by using π(π), the class number which is the order of the group π(π), we have for π(π) = π = 2ππ0, where π0 is odd, then for π =< π, π, π >β πΆ(π) and for πΉ = πππ, either πΉ = πΌ
2 Factorization using square root of a square binary quadratic form
In this section we propose a method to compute ambiguous forms without using the class number
π(π) but by finding square root of square binary quadratic forms. In this context we first describe the method of finding a square root of a binary quadratic form.
2.1 Square root of a binary quadratic form
By the definition of composition on π(π) any class containing a binary quadratic form π is a square root of class containing π β π, and as any quadratic form π~π β π is also in the same class we consider π as a square root of all such forms π that are equivalent to π2.In the following theorem we look at possibilities for a square root for a given binary quadratic form.
Theorem 2.1.1 If a primitive binary quadratic form π(π₯, π¦) = ππ₯2+ ππ₯π¦ + ππ¦2 represents π§2
with (π₯, π¦) = 1, then there exists a binary quadratic form π such that π2 = (π§2, πβ², πβ²) for some
πβ², πβ² β β€ and π~π2 . In particular, π is a square root of π .
Proof. Let π(π₯, π¦) = ππ₯2 + ππ₯π¦ + ππ¦2 be a square binary quadratic form and let (π’, π£, π§) be a solution of the quadratic equation π(π₯, π¦) = π§2 with gcd(π’, π£) = 1. Then there exists integers
π, π such that πππ‘ π’π£ ππ = 1.
Now for π = π’ π
π£ π , we have π(π(π’, π£)) = πβ²π’2+ πβ²π’π£ + πβ²π£2, where πβ² = π(π’, π£) = π§2
πβ² = 2ππ’π + π(π’π + π£π) + 2ππ£π πβ² = π(π, π ) = ππ2+ πππ + ππ 2
and by definition of equivalence as π(π₯, π¦)~π(π(π₯, π¦)) we have (π, π, π)~(πβ², πβ², πβ²) = (π§2, πβ², πβ²). Hence π is equivalent to the square form (π§2, πβ², πβ²). We have the class containing π
given as < π, π, π > is in π(π), therefore the class < πβ², πβ², πβ² > is also in π(π) with
< π, π, π >=< πβ², πβ², πβ² >=< π§2, πβ², πβ² > =< π§, πβ², π§πβ² >β< π§, πβ², π§πβ² > in π(π) by definition of composition β.
π‘ππππππππ, for (π§, πβ², π§πβ²) = π as (π§2, πβ², πβ²) = π β π = π2, we have π is a square root of
(π§2, πβ², πβ²) and the class containing π is a square root of class containing (π§2, πβ², πβ²) in particular square root of class containing π.
Therefore,we have π is a square root of π .
It is noted that if π = (π2, π, π), then π is a square form and π has a square root given as
(π, π, ππ). Now in the following theorem we prove that if π is of the form π = (π, π, π2) then again π has a square root.
Theorem 2.1.2 If π is a binary quadratic form with π or π square and discriminant π < 0, then there is a square form with discriminant π that is equivalent to π.
Proof. Let π(π₯, π¦) = ππ₯2+ ππ₯π¦ + ππ¦2 be a binary quadratic form with π or π is a square. Suppose π is a square and if π = π§2, for some integer π§, then we have π = (π, π, π) = (π§2, π, π)
a square form.
Since π = π‘2 we have
ππ₯2 + ππ₯π¦ + π‘2π¦2 = π§2
β π₯(ππ₯ + ππ¦) = π§2β π‘2π¦2 now by settingπ§+π‘π¦
π₯ =
ππ₯ +ππ¦
π§βπ‘π¦ = π(π ππ¦),
we have π§(π β π2) β π = βπ¦(π‘π2+ ππ + ππ‘)
then, π§ = ππ¦ πππ π =π‘π2+ππ +ππ‘
π2βπ = π π where π
π is a fraction in its lowest terms. Then, we have
π₯ = π π+π‘π
π
π¦ = ππ π§ = ππ
and varying π and π a complete set of solutions to the binary quadratic equation π(π₯, π¦) = π§2
with π as a square is obtained.
Then from the set of solutions,we have for a solution (π₯, π¦, π§) with gcd(π₯, π¦) = 1, as π properly represents π§2 by above theorem(3) we have π = (π, π, π)~(π§2, πβ², πβ²), a square form equivalent and (π§, πβ², π§πβ²) is a square root of π.
For example note for π = (6,3,4) a binary quadratic form with π = 4 = 22 = π‘2, we have the solution of the binary equation π(π₯, π¦) = π§2 , given as π₯ = 7, π¦ = β5, π§ = 17, fππ π = 1 aππ π = 1 in the formulas above and π(7, β5) = 289 = 172 = π§2 . Then for π2 =
(π§2, πβ², πβ²) = (289, 245, 52)~π implies π = (π§, πβ², π§πβ²) = (17, 245, 884) is a square root of f.
2.2 Implementing Factorization with square root of a square binary quadratic form
In this method we propose to obtain a square binary quadratic form from a positive definite binary quadratic form and construct an ambiguous form via the square root of a square binary quadratic form to implement the factorization of a composite number π = ππ for π, π primes.
Theorem 2.2.1 If π is a square binary quadratic form with discriminant π < 0 then there is an ambiguous form ππ(π) where (π(π) is the order of the class containing f, in π(π), leading to factorization of a composite number π = ππ for some binary quadratic form π.
Proof. Let (π, π, π) be a binary quadratic form with discriminant π for some integers π, π, π.By the above theorem if the form (π, π, π) is such that π or π is a square, then we have a square binary quadratic form π. Now first note in any case we can obtain a square form π β π for some class π in π(π) for if (π, π, π) for some integers π, π, π is such that
Case(1): (π, π, π) is not primitive i.e., gcd(π, π, π) = π‘ > 1, then the form π = (π‘2, π, π π‘
π π‘) is of discriminant π2β 4 β π‘2β ππ
π‘2 = π
2 β 4ππ = π and π is a square form of discriminant π.
Case(2): If (π, π, π) is primitive, then gcd(π, π, π) = 1 and we have two sub cases
(π)gcd(π, π) β 1 (ππ)gcd(π, π) = 1
case(i): If gcd(π, π) β 1 then for gcd(π, π) = π‘ > 1, we have π = (π‘2, π, π π‘
π
form of discriminant π.
case(ii): If gcd(π, π) = 1, then for gcd(π, π) = 1 we have π β π = (π, π, π) β (π, π, π) = (π2, π,π2βπ
4π2 ) is a square form of discriminant π and for gcd π, π β 1 if gcd π, π = π‘ > 1, we take g = πβ², π, ππ‘ with πβ² =π
π‘ then we have π β π = (πβ², π, ππ‘) β (πβ², π, ππ‘) = (πβ²
2, π,π2βπ 4πβ²2) is a square form of discriminant π.
Now for implementation of factorization with ambigous form take π = (π2, π, π), a primitive square binary quadratic form such that < π >β π0 in π(π). Then for π = (π2, π, π) = (π, π, ππ) β (π, π, ππ) = π β π, we have π = (π, π, ππ) is a square root of π. Now if order of the class containing the form π is denoted as π(π), then (ππ(π))2 = π2π(π)= ( π)2π(π) = ππ(π) = πΌ
π. Therefore the reduced form of ππ(π) is an ambiguous form. Now using this ambiguous form, we implement factorization on a composite number given as π = ππ for π, π
distinct odd prime factors accordingly as π β‘ 3(mod4) or π β‘ 1(mod4).
In the case when π β‘ 3(mod4), we have π = βπ and the reduced form of ππ(π) is of the form
(1
4(π’ + π£), 1
2(π£ β π’), 1
4(π’ + π£)) ,0 < 1
3π£ β€ π’ β€ π£ or (π’, π’ , 1
4(π’ + π£)),0 < π’ β€ 1
3(π£) with
π = βπ’π£ and gcd(π’, π£) = 1 i.e., π’π£ = βπ = π thus factoring π as π’π£.
In the case when π β‘ 1(mod4), for any π β (2,2,1+π
2 ), we have π = β4π and the reduced form of ππ(π) is of the form (1
2(π’ + π£) , (π£ β π’) , 1
2(π’ + π£)) , 0 < 1
3π£ β€ π’ β€ π£ or
(2π’, 2π’,1
2(π’ + π£)) ,0 < π’ β€ 1
3(π£), with βπ
4 = βπ’π£ and gcd(π’, π£) = 1 i.e., π’π£ = βπ
4 = π thus factoring π as π’π£ in this case as well.[11]
Note if ππ(π) is an ambiguous form equivalent to identity or (2,2, (N+1)/2) (in the case when
π β‘ 1(mod4)), the ambiguous form leads to trivial factorization. So if such ambiguous is not obtained then we go for another choice of square form f.
Example 2.2.2 : To find factors of N = 41347:
For N = 41347 since π β‘ 3 mod4 , we have for π = βπ = β413477. The group π π is with the identity class as < 1,1,10337 > . Take π = 49,3,211 a square binary quadratic form with π = 72 = π§2, then by above theorem 2.1.2 we have π = 49,3,211 = 7,3,1477 β
7,3,1477 with π = 7,3,1477 the square root of π. By above theorem 2.2.1, as ππ π is an ambiguous form we proceed to compute ππ, using the composition and reduction process as given in the below algorithm for m = 1,2.... . We have
π2 = π = (49,3,211), π3 = π2β π = < 49,3,211 >β< 7,3,1477 > = < 343,199,59 >.
The reduced form of π3 is (59,37, 181). So on repeating the process, at 12th
iteration, we have π13 = < 581, β445,103 > with its reduced form equal to (103,33,103), an ambiguous form of the type (a,b,a). Now by implementing the lemma we have the factorization of given N by cosidering (103,33,103) as the form (1
4(π’ + π£), 1
2(π£ β π’), 1
we have π’ = 173 and π£ = 239, with N = βπ = π’π£ = 173 β 239.
2.3 Algorithm to find the ambiguous form
Step1: Start
Step2: Input the values of π, π, π such that π = π‘2 where π‘ is a positive integer.
Step3:Calculate discriminant π = π2 β 4ππ
Step4:
If π β‘ 0(πππ4) , then compute πΌπ = (1,0, βπ
4 ) Else
{
If π β‘ 1(πππ)4 , then compute πΌπ = (1,1, (1βπ)
4 )
}
Step5: Find the reduced form of (π, π, π) as below and verify whether the result β πΌπ otherwise go to step 1.
Step6: Let the input of reduction process be (ππ, ππ, ππ) =(π‘, π, π‘π)
Step7: [ Reduction process ]
while(ππ > ππ or πππ (ππ) > ππ or (ππ == ππ and ππ < 0) or (ππ == βππ and ππ < ππ)) If(ππ > ππ or (ππ == ππ and ππ < 0)) then (ππ, ππ, ππ) = (ππ, βππ, ππ)
If(πππ (ππ) > ππ or (ππ == βππ and ππ < ππ)) then Compute π = ππ
2ππ and πβ²π as below
πΏ1: πβ²π = ππ β 2πππ, (1)
πΌππππ (πβ²π) <= ππ)thenππ = πβ²π (2)
Else Repeat the steps from L1 by incrementingπ by 1 (3)
Computeππ =ππ2βπ
4ππ (4)
Return (ππ, ππ, ππ)
Step8: with the obtained reduced form (ππ, ππ, ππ) find the composition as below.
Step9:[Composition process]
Let (π1, π1, π1) and (π2, π2, π2) be two primitive quadratic forms such that
π = π12β 4π1π1 = π22β 4π2π2
For the first iteration π1 = π2 = π‘, π1 = π2 = π, π1 = π2 = π‘π
For the next iterations π1 = ππ, π1 = ππ, π1 = ππ where ππ, ππ, ππ output of reduced form obtained from step 10 π2, π2, π2 is same as first iteration.
We compute π3, π3, π3 such that
< π1, π1, π1 >β< π2, π2, π2 >=< π3, π3, π3 > as follows Evaluate
π = gcd(π1, π2, (π1+ π2)/2)
π3 = (π1π2) π2
π3 is an integer solution that satisfies
π3 β‘ π1(πππ2π1/π)
π3 β‘ π2(πππ2π2/π)
π3 = (π32βπ)
4π3
Step10: Go to step 7 and let the input of reduction process be ππ = π3, ππ = π3, ππ = π3.
Step11: Repeat step 9 by inputting the reduced form (ππ, ππ, ππ) obtained from step 7 until ππ == 0 or ππ == ππ or ππ == ππ which results to an ambiguous form.
Step12:Stop
3. Conclusion:
In Shankβs Class Group Factorization Method, the factorization method is based on composition of binary quadratic forms and computation of class number π(π). In the method proposed by us, the factorization is based on finding the square root of square binary quadratic form and depends on the order of the class containing the square form. The complexity is based on composition and reduction algorithms of binary quadratic forms. For any form (a, b, c) the reduction depends on πο£ π/3 and hence the complexity is π( π). The advantage of the proposed method is that it does not depend on the computation of the class number π(π).
References
Journal Papers
[2] D.J.Guan, Introduction to the Shankβs SQUFOF Integer Factoring Algorithm, May 26, 2010.
[1] Dr P.Anuradha Kameswari, Factorization via difference of squares using ambiguous forms, IOSR-JM, 2016
[2] Benzamin Bakker, Lecture Notes: Quadratic Forms.
Chapters In Books
[3] Larry J.Gerstein, Basic Quadratic Forms, Graduate studies in Mathematics, vol 90, American Mathematical Society Providence, Rhode Island, ISBN:978-0-8218-4465-6.
[4] Hans Riesel, Prime Numbers and Computer Methods for Factorization, 1985, Birkha user Inc, ISBN 0-8176-3291-3.
[6]Alan Baker, A Coprehensive Course in Number Theory, cambridge university press,2012,ISBN 978-1-107-01901-0.
[7]Franz Lemmermeyer, Binary Quadratic Forms, An Elementary Approach to the Arithmetic of Elliptic and Hyper Elliptic Curves,Nov 8, 2010.
[8] Rick L.Shepherd, Binary Quadratic Forms and Genus Theory, 2013 , The University of North Caarolina at Greesboro.
[9]Richard Crandall, Carl Pomerance,Prime Numbers: A Computational Perspective, Springer Science + Business MediaInc., 2005,ISBN-10: 0-387-25282-7.
[10]D.Shank, Class Number, A Theory of Factorization and Genera, Proc. Symposium of Pure Mathematics, vol.20, American Mathematical Society, 1969.