PRIMALITY TEST FOR FERMAT NUMBERS USING QUARTIC RECURRENCE EQUATION. Predrag Terzic Podgorica, Montenegro

Similar documents
Lucas Lehmer primality test - Wikipedia, the free encyclopedia

Problem Set 5 Solutions

Corollary 4.2 (Pepin s Test, 1877). Let F k = 2 2k + 1, the kth Fermat number, where k 1. Then F k is prime iff 3 F k 1

On the Composite Terms in Sequence Generated from Mersenne-type Recurrence Relations

Discrete Structures Lecture Primes and Greatest Common Divisor

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

Sums of Squares. Bianca Homberg and Minna Liu

Basic Proof Examples

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

History of Mathematics

Primality tests for specific classes ofn = k 2 m ±1

Selected Chapters from Number Theory and Algebra

Primality Proofs. Geoffrey Exoo Department of Mathematics and Computer Science Indiana State University Terre Haute, IN

God may not play dice with the universe, but something strange is going on with the prime numbers.

Divisibility in the Fibonacci Numbers. Stefan Erickson Colorado College January 27, 2006

LARGE PRIME NUMBERS. In sum, Fermat pseudoprimes are reasonable candidates to be prime.

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Math 4400/6400 Homework #8 solutions. 1. Let P be an odd integer (not necessarily prime). Show that modulo 2,

Ch 5.7: Series Solutions Near a Regular Singular Point, Part II

Part II. Number Theory. Year

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Chapter 1. Number of special form. 1.1 Introduction(Marin Mersenne) 1.2 The perfect number. See the book.

The Impossibility of Certain Types of Carmichael Numbers

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

A SURVEY OF PRIMALITY TESTS

Prime and Perfect Numbers

Wilson s Theorem and Fermat s Little Theorem

Equivalence of Pepin s and the Lucas-Lehmer Tests

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

The Fibonacci Quarterly 44(2006), no.2, PRIMALITY TESTS FOR NUMBERS OF THE FORM k 2 m ± 1. Zhi-Hong Sun

Math in the News: Mersenne Primes

Math 261 Spring 2014 Final Exam May 5, 2014

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

EXAMPLES OF MORDELL S EQUATION

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Math 319 Problem Set #2 Solution 14 February 2002

Introduction to Number Theory

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Classification of Finite Fields

School of Mathematics

On the Cardinality of Mersenne Primes

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

Zsigmondy s Theorem. Lola Thompson. August 11, Dartmouth College. Lola Thompson (Dartmouth College) Zsigmondy s Theorem August 11, / 1

Number Theory Proof Portfolio

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Applied Cryptography and Computer Security CSE 664 Spring 2018

Number Theory A focused introduction

Number Tree LCM HCF Divisibility Rules Power cycle Remainder Theorem Remainder of powers a n b n Last and Second last digit Power of Exponents Euler s

Pseudoprimes and Carmichael Numbers

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;.

Number Theory Homework.

Primes. Rational, Gaussian, Industrial Strength, etc. Robert Campbell 11/29/2010 1

Primality testing: variations on a theme of Lucas. Carl Pomerance, Dartmouth College Hanover, New Hampshire, USA

THE TRIANGULAR THEOREM OF THE PRIMES : BINARY QUADRATIC FORMS AND PRIMITIVE PYTHAGOREAN TRIPLES

ABSTRACT 1. INTRODUCTION

Ma/CS 6a Class 4: Primality Testing

5: The Integers (An introduction to Number Theory)

Solutions to Practice Final

Theoretical Cryptography, Lecture 13

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

A Guide to Arithmetic

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

A Generalization of Wilson s Theorem

Notes on Systems of Linear Congruences

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Intermediate Math Circles March 6, 2013 Number Theory I

Discrete Logarithms. Let s begin by recalling the definitions and a theorem. Let m be a given modulus. Then the finite set

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

MATH 152 Problem set 6 solutions

A Proof of the Lucas-Lehmer Test and its Variations by Using a Singular Cubic Curve

Diophantine triples in a Lucas-Lehmer sequence

The running time of Euclid s algorithm

CS383, Algorithms Spring 2009 HW1 Solutions

The primitive root theorem

MATH 25 CLASS 8 NOTES, OCT

With Question/Answer Animations. Chapter 4

Chapter 5.1: Induction

Arithmetic Algorithms, Part 1

Constructing Tower Extensions of Finite Fields for Implementation of Pairing-Based Cryptography

201-1A5-MT - Mathematics Summer 2015 HOMEWORK 2 Deadline : Sunday, August 30, 2015 at 12 :30.

Proposed by Jean-Marie De Koninck, Université Laval, Québec, Canada. (a) Let φ denote the Euler φ function, and let γ(n) = p n

Appendix G: Mathematical Induction

Odd prime values of the Ramanujan tau function

Climbing an Infinite Ladder

Solutions of the Diophantine Equation 2 x + p y = z 2 When p is Prime

PRIMES is in P. Manindra Agrawal. NUS Singapore / IIT Kanpur

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

The knapsack Problem

7. Prime Numbers Part VI of PJE

Primality testing: then and now

Homework #2 solutions Due: June 15, 2012

Basic elements of number theory

Transcription:

PRIMALITY TEST FOR FERMAT NUMBERS USING QUARTIC RECURRENCE EQUATION Predrag Terzic Podgorica, Montenegro pedja.terzic@hotmail.com Abstract. We present deterministic primality test for Fermat numbers, F n = n + 1, where n. Essentially this test is similar to the Lucas-Lehmer primality test for Mersenne numbers. 1. Introduction. Fermat numbers were first studied by Pierre de Fermat, who conjuctured that all Fermat numbers are prime. This conjecture was refuted by Leonhard Euler in 173 when he showed that F 5 is composite. It is known that F n is composite for 5 n 3. Question,are there infinitely many Fermat primes is still an open problem. In 1856 Edouard Lucas has developed primality test for Mersenne numbers. Test was improved by Lucas in 1878 and Derrick Lehmer in 1930 s. The test uses a sequence S i defined by S 0 = 4 and S i+1 = S i for i 1. Mersenne number M p is prime if and only if M p divides S p. In this paper we give primality test for Fermat numbers using quartic recurrsive equation : S i = S 4 i 1 4S i 1 +. The test uses a sequence defined by this recursion.. The test and Proof of correctness.1. The test. Let F n = n + 1 with n. In pseudocode the test might be written : //Determine if F n = n + 1 is prime FermatPrime(n) var S = 8 var F = n + 1 repeat n 1 1 times : S = (((S S) ) ((S S) ) ) (mod F ) if S = 0 return PRIME else return COMPOSITE Date: January 11, 01. 1

PREDRAG TERZIC.. Proof of correctness. Let us define sequence S i as : { 8 if i = 0; S i = (Si 1 ) otherwise. Theorem.1. F n = n + 1, (n ) is a prime if and only if F n divides S n 1 1. Proof. Let us define ω = 4 + 15 and ω = 4 15 and then define L n to be ω n + ω n, we get L 0 = ω + ω = 8, and L n+1 = ω n+ + ω n+ = (ω n+1 ) + ( ω n+1 ) = = (ω n+1 + ω n+1 ) ω n+1 ω n+1 = = ((ω n + ω n ) ω n ω n ) ω n+1 ω n+1 = = ((ω n + ω n ) (ω ω) n ) (ω ω) n+1 and since ω ω = 1 we get : L n+1 = (L n ) Because the L n satisfy the same inductive definition as the sequence S i, the two sequences must be the same. Proof of necessity : If n + 1 is prime then S n 1 1 is divisible by n + 1 We rely on simplification of the proof of Lucas-Lehmer test by Oystein J. R. Odseth, see [1].First notice that 3 is quadratic non-residue (mod F n ) and that 5 is quadratic non-residue (mod F n ). Euler s criterion then gives us : 3 Fn 1 1 (mod F n ) and 5 Fn 1 1 (mod F n ) On the other hand is a quadratic-residue (mod F n ), Euler s criterion gives: Fn 1 1 (mod F n ) Next define σ = 15, and define X as the multiplicative group of {a + b 15 a, b Z Fn }.We will use following lemmas : Lemma.1. : (x + y) Fn = x Fn + y Fn (mod F n ) Lemma.. : a Fn a (mod F n ) (Fermat little theorem) Then in group X we have : (6 + σ) Fn (6) Fn + (σ) Fn = 6 + ( 15) Fn

PRIMALITY TEST FOR FERMAT NUMBERS USING QUARTIC RECURRENCE EQUATION3 = 6 + Fn 15 Fn 1 15 = 6 + 3 Fn 1 5 Fn 1 15 = 6 + ( 1) ( 1) 15 = 6 + 15 (6 + σ) (mod F n ) We chose σ such that ω = (6+σ). We can use this to compute ω Fn 1 4 in the group X : ω Fn 1 = (6+σ)Fn 1 4 Fn 1 where we use fact that : = (6+σ)Fn (6+σ) 4 Fn 1 (6+σ) (6+σ) ( 1) (mod F n) = 1 (mod F n ) 4 Fn 1 = ( Fn 1 ) 3 (3 Fn 1 ) (1 3 ) ( 1) 1 (mod F n ) So we have shown that : ω Fn 1 1 (mod F n ) If we write this as ω n +1 1 = ω n 1 = ω n ω n 1 (mod F n ),multiply both sides by ω n, and put both terms on the left hand side to write this as : ω n + ω n 0 (mod F n ) ω (n 1 1) + ω (n 1 1) 0 (mod F n ) S n 1 1 0 (mod F n ) Since the left hand side is an integer this means therefore that S n 1 1 must be divisible by n + 1. Proof of sufficiency : If S n 1 1 is divisible by n + 1, then n + 1 is prime We rely on simplification of the proof of Lucas-Lehmer test by J. W. Bruce, see [].If n + 1 is not prime then it must be divisible by some prime factor F less than or equal to the square root of n + 1. From the hypothesis S n 1 1 is divisible by n + 1 so S n 1 1 is also multiple of F, so we can write : ω (n 1) + ω (n 1) = K F, for some integer K. We can write this equality as : ω n + ω n = K F Note that ω ω = 1 so we can multiply both sides by ω n and rewrite

4 PREDRAG TERZIC this relation as : ω n 1 = K F ω n 1. If we square both sides we get : ω n = (K F ω n 1) Now consider the set of numbers a + b 15 for integers a and b where a + b 15 and c + d 15 are considered equivalent if a and c differ by a multiple of F, and the same is true for b and d. There are F of these numbers, and addition and multiplication can be verified to be welldefined on sets of equivalent numbers. Given the element ω (considered as representative of an equivalence class), the associative law allows us to use exponential notation for repeated products : ω n = ω ω ω, where the product contains n factors and the usual rules for exponents can be justified. Consider the sequence of elements ω, ω, ω 3.... Because ω has the inverse ω every element in this sequence has an inverse. So there can be at most F 1 different elements of this sequence. Thus there must be at least two different exponents where ω j = ω k with j < k F. Multiply j times by inverse of ω to get that ω k j = 1 with 1 k j F 1. So we have proven that ω satisfies ω n = 1 for some positive exponent n less than or equal to F 1. Define the order of ω to be smallest positive integer d such that ω d = 1. So if n is any other positive integer satisfying ω n = 1 then n must be multiple of d. Write n = q d+r with r < d. Then if r 0 we have 1 = ω n = ω q d+r = (ω d ) q ωr = 1 q ωr = ω r contradicting the minimality of d so r = 0 and n is multiple of d. The relation ω n = (K F ω n 1) shows that ω n 1 (mod F ). So that n must be multiple of the order of ω. But the relation ω n 1 = K F ω n 1 shows that ω n 1 1 (mod F ) so the order cannot be any proper factor of n, therefore the order must be n. Since this order is less than or equal to F 1 and F is less or equal to the square root of n +1 we have relation : n F 1 n. This is true only if n = F 1 n + 1 = F. We will show that Fermat number cannot be square of prime factor. Theorem.. Any prime divisor p of F n = n + 1 is of the form k n+ + 1 whenever n is greater than one. Proof. For proof see [3] So prime factor F must be of the form k n+ + 1, therefore we can write : n + 1 = (k n+ + 1) n + 1 = k n+4 + k n+ + 1

PRIMALITY TEST FOR FERMAT NUMBERS USING QUARTIC RECURRENCE EQUATION5 n = k n+3 (k n+1 + 1) The last equality cannot be true since k n+1 + 1 is an odd number and n has no odd prime factors so n +1 F and therefore we have relation n < F 1 < n which is contradiction so therefore n + 1 must be prime. 3. Acknowledgments I wish to express my gratitude to Bojan Terzic for grammatical improvement of the text. References 1. Proof of necessity by Oystein J. R. Odseth available at : http : //en.wikipedia.org/wiki/lucas Lehmer primality test. Proof of sufficiency by J. W. Bruce available at : http : //www.mersennewiki.org/index.php/lucas Lehmer T est 3. Proof of Edouard Lucas theorem available at : http : //en.wikipedia.org/wiki/f ermat number