Related papers: Two Algorithms to Find Primes in Patterns
A prime sieve is an algorithm that finds the primes up to a bound $n$. We say that a prime sieve is incremental, if it can quickly determine if $n+1$ is prime after having found all primes up to $n$. We say a sieve is compact if it uses…
In this article, we study the problem of finding the longest common separable pattern between several permutations. We give a polynomial-time algorithm when the number of input permutations is fixed and show that the problem is NP-hard for…
The class $(r,2)$-CSP, or simply Max 2-CSP, consists of constraint satisfaction problems with at most two $r$-valued variables per clause. For instances with $n$ variables and $m$ binary clauses, we present an $O(n r^{5+19m/100})$-time…
Odd numbers can be indexed by the map k(n)=(n-3)/2, n belonging to 2N+3. We first propose a basic primality test using this index function that was first introduced in article (8). Input size of operations is reduced which improves…
We investigate algorithms to find the first vertex in large trees generated by either the uniform attachment or preferential attachment model. We require the algorithm to output a set of $K$ vertices, such that, with probability at least…
Given a sequence of integers, we want to find a longest increasing subsequence of the sequence. It is known that this problem can be solved in $O(n \log n)$ time and space. Our goal in this paper is to reduce the space consumption while…
Let $\mathbf{f} = (f_1, \ldots, f_R)$ be a system of polynomials with integer coefficients in which the degrees need not all be the same. We provide sufficient conditions for which the system of equations $f_j (x_1, \ldots, x_n) = 0 \ (1…
This note investigates the prime values of the polynomial $f(t)=qt^2+a$ for any fixed pair of relatively prime integers $ a\geq 1$ and $ q\geq 1$ of opposite parity. For a large number $x\geq1$, an asymptotic result of the form $\sum_{n\leq…
We show that if you represent all primes with less than n-digits as points in n-dimensional space, then they can be stored and retrieved conveniently using n-dimensional geometry. Also once you have calculated all the prime numbers less…
A new Combined Sieve algorithm is presented with cost proportional to the number of enumerated factors over a series of intervals. This algorithm achieves a significant speedup, over a traditional sieve, when handling many ([10^4, 10^7])…
Let f be a degree D univariate polynomial with real coefficients and exactly m monomial terms. We show that in the special case m=3 we can approximate within eps all the roots of f in the interval [0,R] using just O(log(D)log(Dlog(R/eps)))…
We study permutation (jumbled/Abelian) pattern matching over a general alphabet $\Sigma$. Given a pattern P of length m and a text T of length n, the classical task is to decide whether T contains a length-m substring whose Parikh vector…
The prime number graph is the set of points $(n,p_n)$ where $p_n$ denotes the $n^{\rm th}$ prime. Let $L(n)$ be the minimum number of straight line segments needed to cover the first $n$ points in this set. Let $B(n)$ be the largest number…
We provide a number of algorithmic results for the following family of problems: For a given binary m\times n matrix A and integer k, decide whether there is a "simple" binary matrix B which differs from A in at most k entries. For an…
We give a new proof of F\"urer's bound for the cost of multiplying n-bit integers in the bit complexity model. Unlike F\"urer, our method does not require constructing special coefficient rings with "fast" roots of unity. Moreover, we prove…
Let $n$ and $k$ be positive integers, and $f_n(k)$ (resp. $g_n(k)$) be the number of unital subrings (resp. unital irreducible subrings) of $\mathbb{Z}^n$ of index $k$. The numbers $f_n(k)$ are coefficients of certain zeta functions of…
We show that given the order of a single element selected uniformly at random from $\mathbb Z_N^*$, we can with very high probability, and for any integer $N$, efficiently find the complete factorization of $N$ in polynomial time. This…
The Permutation Pattern Matching problem, asking whether a pattern permutation $\pi$ is contained in a permutation $\tau$, is known to be NP-complete. In this paper we present two polynomial time algorithms for special cases. The first…
We present a polynomial-time algorithm that discovers all maximal patterns in a point set, $D\subset\mathbb{R}^k$, that are related by transformations in a user-specified class, $F$, of bijections over $\mathbb{R}^k$. We also present a…
In this work, we obtain the following new results. 1. Given a sequence $D=((h_1,s_1), (h_2,s_2) ..., (h_n,s_n))$ of number pairs, where $s_i>0$ for all $i$, and a number $L_h$, we propose an O(n)-time algorithm for finding an index interval…