Generating Primes - Complexity

Complexity

The sieve of Eratosthenes is generally considered the easiest sieve to implement, but it is not the fastest. It can find all the primes up to N in time O(N), while the sieve of Atkin and most wheel sieves run in sublinear time O(N/log log N). The sieve of Atkin takes space N1/2+o(1); segmented Eratosthenes' sieve takes slightly less space than O(N1/2). Sorenson shows an improvement to the wheel sieve that takes even less space at O(N/((log N)Llog log N) for any L > 1.

Read more about this topic:  Generating Primes

Famous quotes containing the word complexity:

    It is not only their own need to mother that takes some women by surprise; there is also the shock of discovering the complexity of alternative child-care arrangements that have been made to sound so simple. Those for whom the intended solution is equal parenting have found that some parents are more equal than others.
    Elaine Heffner (20th century)

    The price we pay for the complexity of life is too high. When you think of all the effort you have to put in—telephonic, technological and relational—to alter even the slightest bit of behaviour in this strange world we call social life, you are left pining for the straightforwardness of primitive peoples and their physical work.
    Jean Baudrillard (b. 1929)

    In times like ours, where the growing complexity of life leaves us barely the time to read the newspapers, where the map of Europe has endured profound rearrangements and is perhaps on the brink of enduring yet others, where so many threatening and new problems appear everywhere, you will admit it may be demanded of a writer that he be more than a fine wit who makes us forget in idle and byzantine discussions on the merits of pure form ...
    Marcel Proust (1871–1922)