require 'prime' 
require 'openssl' 

i, urutan, primorial_number = 1, 1, OpenSSL::BN.new(1)
start = Time.now
prime_array = Prime.first (500)

until urutan > 20
  primorial_number *= prime_array[i-1] 
  if (primorial_number - 1).prime_fasttest? || (primorial_number + 1).prime_fasttest?
    puts 
    urutan += 1
  end 
  i += 1
end