**60 primes questions.**

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?

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
...

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 ...

Does the following recursive algorithm have a name? If so, what is it?
...

I was trying to write my own code for primes in Python. I know that code already exists, but I am doing this to challenge my knowledge and make my own solution. I was wondering if any of you guys ...

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

- "to be impressed" in Japanese
- Were external floppy drives for Atari ST and Amiga inter-compatible?
- Short story about a man who has duplicates of himself appear behind him
- Why might plasma weapons have different colors, even when made by the same manufacturer?
- Why didn't the linguistic split overlap with the religion split in Prussian Silesia?
- A word for taking a picture by satellite
- Does everything have to be accurate?
- What is the word for using one word to replace another for cosmetic reasons?
- What advantages do students have who learn how to touch type?
- How to ask a non-programmer not to advise me on programming tasks
- How to set personal hygiene standards with my boyfriend?
- How to use Nearest as a lookup function?
- Runaway argument? with \newcommand[2]
- Saying "No" to my brother's demand without causing an argument
- pointer to member function in fold expression
- Soil of gem powder
- Inadvertently removing .ssh/authorized_keys , is it a serious mistake?
- MultiClassing and Gaining Abilities on Level up
- How to highlight some inline text using parbox?
- What should my redraft phase entail?
- Springs in parallel store less energy than springs in series ... but where does the excess energy go?
- How to choose a good grading curve for yes/no exams?
- Generate trafic with a specified throughtput
- Metal-Feathered Macaw Viability