Horje
Mathematical Algorithms - Prime numbers and Primality Tests

What is Prime Number?

A prime number is a natural number greater than 1 that is divisible by only 1 and the number itself.

In other words, the prime number can be defined as a positive integer greater than that has exactly two factors, 1 and the number itself. First 10 prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.

Note: 1 is neither a prime number nor a composite number. All other numbers can be classified as prime or composite.

Some important theorems related to prime numbers are mentioned here:

What is Primality Test?

Primality Test is an algorithm to determine whether a number is prime or not.

Unlike integer factorization, primality test only states if the input is prime or not and does not generally provide prime factors. Some of the frequently used primality test algorithms are stated below

Primality Test algorithms

School Method

Fermat Method of Primality Test

Miller-Rabin Primality Test

Solovay-Strassen method of Primality Test

Baillie-PSW Primality Test

Lucas Primality Test

AKS Primality Test

Vantieghems Theorem for Primality Test

Wilson Primality Test

Primality Test using Lucas-Lehmer Series

Easy Problems on Prime Numbers:

Medium Problems on Prime Numbers::

Hard Problems on Prime Numbers:

Quick Links:




Reffered: https://www.geeksforgeeks.org


DSA

Related
Coding Problems on Matrix Data Structure Coding Problems on Matrix Data Structure
Checking and Printing Binary Tree Checking and Printing Binary Tree
Binary Tree Traversal Binary Tree Traversal
Linked List Data Structure Linked List Data Structure
Print maximum number of ‘A’ using given four keys Print maximum number of ‘A’ using given four keys

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12