87 research outputs found

    Two Compact Incremental Prime Sieves

    Get PDF
    A prime sieve is an algorithm that finds the primes up to a bound nn. We say that a prime sieve is incremental, if it can quickly determine if n+1n+1 is prime after having found all primes up to nn. We say a sieve is compact if it uses roughly n\sqrt{n} space or less. In this paper we present two new results: (1) We describe the rolling sieve, a practical, incremental prime sieve that takes O(nloglogn)O(n\log\log n) time and O(nlogn)O(\sqrt{n}\log n) bits of space, and (2) We show how to modify the sieve of Atkin and Bernstein (2004) to obtain a sieve that is simultaneously sublinear, compact, and incremental. The second result solves an open problem given by Paul Pritchard in 1994

    Sieving for pseudosquares and pseudocubes in parallel using doubly-focused enumeration and wheel datastructures

    Full text link
    We extend the known tables of pseudosquares and pseudocubes, discuss the implications of these new data on the conjectured distribution of pseudosquares and pseudocubes, and present the details of the algorithm used to do this work. Our algorithm is based on the space-saving wheel data structure combined with doubly-focused enumeration, run in parallel on a cluster supercomputer

    Online Sorting via Searching and Selection

    Full text link
    In this paper, we present a framework based on a simple data structure and parameterized algorithms for the problems of finding items in an unsorted list of linearly ordered items based on their rank (selection) or value (search). As a side-effect of answering these online selection and search queries, we progressively sort the list. Our algorithms are based on Hoare's Quickselect, and are parameterized based on the pivot selection method. For example, if we choose the pivot as the last item in a subinterval, our framework yields algorithms that will answer q<=n unique selection and/or search queries in a total of O(n log q) average time. After q=\Omega(n) queries the list is sorted. Each repeated selection query takes constant time, and each repeated search query takes O(log n) time. The two query types can be interleaved freely. By plugging different pivot selection methods into our framework, these results can, for example, become randomized expected time or deterministic worst-case time. Our methods are easy to implement, and we show they perform well in practice

    Genetic Algorithms for the Extended GCD Problem

    Get PDF
    We present several genetic algorithms for solving the extended greatest common divisor problem. After defining the problem and discussing previous work, we will state our results

    Polylog Depth Circuits for Integer Factoring and Discrete Logarithms

    Get PDF
    AbstractIn this paper, we develop parallel algorithms for integer factoring and for computing discrete logarithms. In particular, we give polylog depth probabilistic boolean circuits of subexponential size for both of these problems, thereby solving an open problem of Adleman and Kompella. Existing sequential algorithms for integer factoring and discrete logarithms use a prime base which is the set of all primes up to a bound B. We use a much smaller value for B for our parallel algorithms than is typical for sequential algorithms. In particular, for inputs of length n, by setting B = nlogdn with d a positive constant, we construct •Probabilistic boolean circuits of depth (log) and size exp[(/log)] for completely factoring a positive integer with probability 1−(1), and •Probabilistic boolean circuits of depth (log + log) and size exp[(/log)] for computing discrete logarithms in the finite field () for a prime with probability 1−(1). These are the first results of this type for both problem

    The pseudosquares prime sieve

    Get PDF
    Abstract. We present the pseudosquares prime sieve

    An Algorithm for Ennola's Second Theorem and Counting Smooth Numbers in Practice

    Full text link
    Let Ψ(x,y)\Psi(x,y) count the number of positive integers nxn\le x such that every prime divisor of nn is at most yy. Given inputs xx and yy, what is the best way to estimate Ψ(x,y)\Psi(x,y)? We address this problem in three ways: with a new algorithm to estimate Ψ(x,y)\Psi(x,y), with a performance improvement to an established algorithm, and with empirically based advice on how to choose an algorithm to estimate Ψ\Psi for the given inputs. Our new algorithm to estimate Ψ(x,y)\Psi(x,y) is based on Ennola's second theorem [Ennola69], which applies when y0y0. It takes O(y2/logy)O(y^2/\log y) arithmetic operations of precomputation and O(ylogy)O(y\log y) operations per evaluation of Ψ\Psi. We show how to speed up Algorithm HT, which is based on the saddle-point method of Hildebrand and Tenenbaum [1986], by a factor proportional to loglogx\log\log x, by applying Newton's method in a new way. And finally we give our empirical advice based on five algorithms to compute estimates for Ψ(x,y)\Psi(x,y).The challenge here is that the boundaries of the ranges of applicability, as given in theorems, often include unknown constants or small values of ϵ>0\epsilon>0, for example, that cannot be programmed directly

    Modular exponentiation via the explicit Chinese remainder theorem

    Get PDF
    In this paper we consider the problem of computing xe mod m for large integers x, e, and m. This is the bottleneck in Rabin’s algorithm for testing primality, the Diffie-Hellman algorithm for exchanging cryptographic keys, and many other common algorithms
    corecore