Talk:Sequence of primorial primes

From Rosetta Code

Python library[edit]

It looks like the isprime function from the library used in the Python example is no longer present in the new version. is_probable_prime is the new function. Danaj (talk) 03:28, 15 June 2015 (UTC)

Can you give a link? --Paddy3118
Ah, found it. It seems that isprime becomes is_prime in the later version. The link is to the earlier version so I won't hurry to update to the new library. --Paddy3118 (talk) 04:51, 15 June 2015 (UTC)

Ring's Code Produced Error Message[edit]

I tried to run Ring code suggested in this page, copy-paste to file named primo.ring

# Project : Sequence of primorial primes

max = 9999
primes = []
for n = 1 to max
     if isprime(n) = 1
        add(primes, n)
     ok
next
for n = 1 to len(primes)
     sum = 1
     for m = 1 to n
          sum = sum * primes[m]
     next
     if (isprime(sum+1) or isprime(sum-1)) = 1
        see "" + n + " "
     ok
next
 
func isprime(num)
       if (num <= 1) return 0 ok
       if (num % 2 = 0) and num != 2 return 0 ok
       for i = 3 to floor(num / 2) -1 step 2
            if (num % i = 0) return 0 ok
       next
       return 1

The code produced error message:

1 2 3 4 5 6
Line 22 Error (R18) : Numeric Overflow!
In function isprime() in file primo.ring
called from line 15  in file primo.ring

I used Ring version 1.10 to run the code.