**62 primes questions.**

I am currently studying the paper Primes is in P and have a question regarding 5 section of this paper. Line 1 of the algorithm (on page 3) requires the following operation to be performed
...

When we compute the complexity of calculating factorial of a number $n$ why is it in terms of $n$ instead of the number of the number of bits occupied by the number of bits occupied by $n$ (like we do ...

Bear in mind I'm almost a complete noob at complexity theory.
I was reading about how AKS Primality shows that numbers of size n can be shown to be prime or composite in polynomial time. Given that, ...

Are thre any efficient algorithms for checking if a list of integers is pairwise coprime, or would a more general algorithm be the best option available?

In his "Notes on Structured Programming" essay, E. W. Dijkstra gives an example of a program that computes the first 1000 primes (Section 9. "A First Example of Step-Wise Program Composition").
The ...

Suppose I have a sequence:
$$n = \prod_{i=1}^{r(n)} p_i^{d_i}$$
for some primes $p_1 < p_2 < \dots < p_{r(n)}$, and each $d_i \geq 1$ an integer. The function $r(n)$ denotes the number of ...

Fermat's Little Theorem states that if an integer $n$ is prime them
$$
a^n \equiv a \pmod n \hspace{10mm} (*)
$$
for any $a \in \mathbb{N}$
My question is, is it correct to say that testing $(*)$ for ...

In the paper "PRIMES is in P" the following is said (page 1):
Let PRIMES denote the set of all prime numbers. The definition of prime numbers already gives a way of determining if a number $n$ is ...

I want to write a Turing machine which checks for unary powers of 2 but without the use 0s, only accepting as input a series of 1s and dashes. I do not know of a sequence of states which would allow ...

Suppose that I want to compute all the prime numbers between 2 and $n$. The natural way or most obvious way to do so is given below. Let $A$ is an array contain the numbers from $1$ to $n$.
For $j=2$ ...

Consider receiving as input $x\in\mathbb N$ and computing some (any) prime $p\in[x,2x]$.
What is the complexity of the above problem?
A natural way to approach this problem is to generate random ...

I've been having some fun with prime numbers. A few months ago I sat down to see if I could write something that could compete with Atkin Sieve and ended up with an algorithm that, on my local tests ...

From the proof of Miller-Rabin, if a number passes the Fermat primality test, it must also pass the Miller-Rabin test with the same base $a$ (a variable in the proof). And the computation complexity ...

The computational complexity of primality testing is usually specified in relation to the bit length of the number being tested.
However, Mersenne numbers have the special property that the ...

I have recently stumbled upon the following interesting article which claims to efficiently compress random data sets by always more than 50%, regardless of the type and format of the data.
Basically ...

Today I had an insight into an alternative deterministic algorithm for testing the primality of a number. I want to know if this algorithm is useful, and worth pursuing. I'll describe the idea behind ...

It's clear that Mathematica uses the Baillie–PSW test for its PrimeQ function (which tests primality), and as I read in the Mathematica documentation, it starts with trial division, then base 2 ...

I have $a_1, a_2,\dots,a_n$ and $b_1,b_2,\dots,b_n$ and an upper bound $U$ and $n$ linear equations of the form:
$k_1 * a_1 + b_1 = x$
$k_2 * a_2 + b_2 = x$
$\dots$
$k_n * a_n + b_n = x$
...

I'm reading the AKS primality test paper as it is found here. I'm confused about a statement in Lemma 4.3:
"Note that $(r, n)$ cannot be divisible by all the prime divisors of $r$ since otherwise $r$...

Why some books state that Primes is a NP problem if, as a decidibility problem, it can be solved in polynomial time?
A simple example:
A number can has its primality tested by dividing it by all ...

I can't quite figure out an algorithm for this:
Given some integer n, what subset of the primes (so no repeats) would yield the lowest possible sum if their product is at least n?
Example: 6 -> 2*3,
...

I have to design a Turing Machine to do the following, but I don't really know where to start with this question. Any help would be very much appreciated.
I should design a Turing Machine accepting ...

Suppose that I am given as input the number $p^i$ for some prime $p$ and some positive integer $i$. I wish to find $p$ and $i$.
Is there an algorithm to do this that works in time polynomial in the ...

In order to tackle this problem I first observed that
$$\phi(p_1^{e_1} \space p_2^{e_2} \cdots \space p_k^{e_k}) = (e_1 + 1)(e_2 + 1)\cdots(e_k +1)$$
Where $\phi(m)$ is the number of (not ...

Let UID denote a unique identifier. UID's are represented as 6-digit positive integers.
I want to insert a collection of UID's in a hash table with $M$ buckets, where $M$ is a prime number (for ...

It is clear that AKS primality proving is the newest one, but as the results show it is not the fastest one.
When I try the 9 digits long prime number it consume about 6 minutes to give you the ...

The naive prime test goes something like this:is_prime(n):
for(i=2; i<=sqrt(n); ++i):
if n mod i == 0 :
return false
return trueIf $n$ is ...

During a programming contest I was asked to find just smallest prime number to given number N.
As Sieve cannot be used and brute force also doesn't work.
So, I was wondering is there any other faster ...

Given an input $m$, I am trying to find an algorithm that will give me the number $p$ that is closest to $\tfrac47 m$ and co-prime with $m$.
Where $m$ is odd, I have no problem producing an outcome ...

I found this problem on codeforces in an ACM archive.
Given a number $n$, find the number possible of ways of expressing that number as a sum of consecutive primes. Example :
Given $n = 41$:
$41 = ...

I am going through undecidability of TM and found this question
$L=\left \{ \left \langle M \right \rangle |M\ is\ TM \ and \ number\ of\ strings\ in\ the\ language\ \ is\ prime\right \}$
I think it ...

The prime-counting function, demoted $\pi(x)$, is defined as the number of prime numbers less than or equal to $x$.
We can define a decision problem from $\pi(x)$ as follows:
Given two numbers $x$ ...

If f(n) is the problem to determine the nth prime number, how fast can this be done, i.e.
What is the fastest known algorithm to find the nth prime number?
What are lower bounds for the time ...

If I have a list of key values from 1 to 100 and I want to organize them in an array of 11 buckets, I've been taught to form a mod function
$$ H = k \bmod \ 11$$
Now all the values will be placed ...

Problem statement can be found here or down below.
The solution which I'm trying to understand can be found here or down below.
Problem Statement.
Peter wants to generate some prime numbers for his ...

Is there any literature/survey/papers/books regarding the factorization of Strong PseudoPrimes (wrt. to a given base).
I am aware of the fact that weak Pseudo Primes can be factorized in Polynomial ...

Could some one please explain how to get the time complexity of checking if a number is prime? I'm really confused as to if it is $O(\sqrt{n})$ or $O(n^2)$.
I iterate from $i=2$ to $\sqrt{n}$ and ...

When using as the set of coins all logarithms of the prime numbers or numbers in general, and when using the logarithm of the number to be factored. The problem is just finding the logarithms that can ...

I have come up with two simple methods for finding all the factors of a number $n$. The first is trial division:
For every integer up to $\sqrt{n}$, try to divide by $d$, and if the remainder is $0$ ...

How do I compute the Jacobi symbol $(N|A)$ efficiently?
In particular, for every odd $N, A$, define the Jacobi symbol $(A|N)$ as $\prod_i Q_{p_i}(A)$ where $p_1, \dots , p_k$ are all the (not ...

I read somewhere that the most efficient algorithm found can compute the factors in $O(\exp((64/9 \cdot b)^{1/3} \cdot (\log b)^{2/3})$ time, but the code I wrote is $O(n)$ or possibly $O(n \log n)$ ...

The trial division algorithm for checking if a number $N$ is prime works by trying to divide $N$ by all integers in the range 2, 3, ..., $\lfloor \sqrt{n} \rfloor$. If any of them cleanly divide $N$, ...

Say I want to find the n-th prime. Is there an algorithm to directly calculate it or must I do with sieving? I know always calculate the next prime with a sieve principle, but what if I want the n-th ...

Does anyone know of an algorithm to generate a set of numbers of size $N$ which are all co-prime to eachother?
Ideally I'm looking for something that has random access abilities so i could ask for ...

The Sieve of Eratosthenes bothers me because you have to specify an upper bound before you begin the algorithm.
Is there a prime sieve that doesn't require this?
More Formally:
Is it possible to ...

I saw from this post on stackoverflow that there are some relatively fast algorithms for sieving an interval of numbers to see if there is a prime in that interval. However, does this mean that the ...

Here is the complete proof taken from this link
How do I convince myself that n(1+b) is not prime when b>=1?
Here is what I did:
if n is 3 and b is 3. Then ...

I am looking for a workload which is hard to paralellise/distribute between multiple machines.
For example, integer factorization does not go 10 times faster if you have 10 machines to split the ...

I am reading Algorithms 4th edition by Robert Sedgewick and am stumped at a particular problem. On page 460 of the book the author is describing a technique to hash strings and use prime numbers for ...

The Sieve of Eratosthenes is an algorithm generate the prime numbers, $2,3,5,7,11,13,...$ by drawing a list of numbers crossing out multiples of the smallest number in the list.
Is there anyway to ...

- algorithms
- complexity-theory
- time-complexity
- number-theory
- algorithm-analysis
- reference-request
- hash
- factoring
- turing-machines
- discrete-mathematics
- hash-tables
- data-structures
- runtime-analysis
- np
- cryptography
- enumeration
- optimization
- undecidability
- strings
- recursion
- complexity-classes
- randomized-algorithms
- sets
- polynomial-time
- efficiency

- Is there any technical reason why, in programming, the default date format is YYYYMMDD and not something else?
- Optimization explained to a middle school kid
- Higher dimensional spheres cause contradictions?
- Bioengineered reversible sterility
- Why does the baseline skip depend on the letters depth in some fonts?
- Teapot Riddle no.29
- Story about an intelligent, walled city; people are reproduced by machines, protagonist rebels and tries to leave
- Is GPL for research purposes only self-contradictory?
- Dreaded by many; loved by few
- simplifying \foreach to repeat a drawing
- How can I make 3D games in 4K that are a few megabytes?
- Power of two Cartesian product of given sets
- How did Obi-Wan know what Darth Vader looked like in Episode IV?
- Is it possible to bind multiple ships together on open water?
- Is there a script I can use to download the Mojave installer without being signed in to the App Store?
- Is the summation of the same irrational number always irrational?
- Did personal computers ever support 8" floppies?
- Periodically replacing values in a list
- Test a transistor with a multimeter
- Are there any natural materials that can be used as a magnifying lens (or to craft one)?
- How do you improve your scientific writing skills?
- What are the consequences for a Warforged that does not spend 6 hours in its inactive state?
- How to make a character work for an idea?
- Usage of Apollo Lunar Surface Hasselblad Camera with 500 mm lens?