prog.sf 422 B

1234567891011121314151617181920
  1. #!/usr/bin/ruby
  2. # Numbers n such that concatenation of first n primes, separated by zeros, is prime.
  3. # https://oeis.org/A082549
  4. # Known terms:
  5. # 1, 9, 15, 25, 59, 444
  6. # Next term >= 5686
  7. # Heuristically, the next term should be close to 8000.
  8. for n in (5686..7000) {
  9. var t = primes(prime(n)).join('0').to_i
  10. say "Testing: #{n} -- length #{t.len}"
  11. if (t.is_prob_prime) {
  12. die "Found: #{n}"
  13. }
  14. }