Problem of the Day
A new programming or logic puzzle every Mon-Fri

Large Primes

Welcome back from another kick ass weekend!

Today's problem digs in to the one of the key factors of cryptology, generating large, random, prime numbers. Today's exercise is to create a program that prints out all prime numbers that can fit in a 32 bit unsigned int.

Permalink: http://problemotd.com/problem/large-primes/

Comments:

  • asheehan - 10 years, 2 months ago

    using Ruby's Prime library (probably considered cheating, but I have a feeling this program will get expanded on tomorrow).

    require 'prime'
    
    max = 2**32
    Prime.each(max) do |prime|
      puts prime
    end
    

    reply permalink

Content curated by @MaxBurstein