# Is there a list of safe prime numbers?

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

-
For ignorant people like me: en.wikipedia.org/wiki/Safe_prime – 1015 Mar 2 '13 at 16:24
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
@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

Here's a list of the first 10000 numbers

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

-
^_^ ${}{}{}{}\;$ – Ricky Demer Sep 10 '13 at 10:01

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

-

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.

-