Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am looking for a list of precomputed safe prime numbers. Where can I get such a list?

share|improve this question
3  
For ignorant people like me: en.wikipedia.org/wiki/Safe_prime –  1015 Mar 2 '13 at 16:24
4  
Maybe you can get them from the same company that will supply you with suggested passwords for your bank account. –  André Nicolas Mar 2 '13 at 17:38
2  
@AndréNicolas All the smart people use correct horse battery staple. –  Trevor Wilson Mar 2 '13 at 17:40
    
@AndréNicolas I don't intend on using them as private keys, but as part of Pohlig-Hellman exponentation cipher. The use of that algorithm will be the most interesting of the ones I have heard about yet. –  ThePiachu Mar 2 '13 at 18:25
add comment

3 Answers 3

Here's a list of the first 10000 numbers

http://oeis.org/A005385/b005385.txt

share|improve this answer
    
^_^ ${}{}{}{}\;$ –  Ricky Demer Sep 10 '13 at 10:01
add comment

http://oeis.org/A005385 ${}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}$

share|improve this answer
add comment

With a little haskell, you can generate what you want.

ld n = ldf 2 n

ldf k n | rem n k == 0 = k
        | k^2 > n      = n
        | otherwise    = ldf (k+1) n

isprime n = isprime' (abs n)

isprime' n
  | n < 2 = False
  | otherwise = ld n == n

issophie n | not (isprime n)     = False
           | isprime (2 * n + 1) = True
           | otherwise           = False

sophies = filter issophie [2..]

safeprimes = map (\x -> 2 * x + 1) sophies

Then something like

first100safes = take 100 safeprimes

the5thsafe = safeprimes!!5

Many safeprimes will take a bit (take 10000 safeprimes). You might want to capture them and keep them somewhere. With a little modification, you can start with a big sophie and work up. Maybe generate the next 10000 and add them to your list. Start things up and go get lunch.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.