prog.sf 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/ruby
  2. # a(n) is the least positive integer not already in the sequence with the property that the concatenation a(0)a(1)...a(n) forms an integer with n distinct prime factors.
  3. # https://oeis.org/A366896
  4. # Known terms:
  5. # 1, 3, 4, 2, 11, 21, 30, 216, 118, 170, 1092, 8484, 97104, 96720, 493170
  6. # New terms:
  7. # a(15) = 251496
  8. # a(16) = 1380652
  9. # a(17) = 12137510
  10. # Lower-bounds:
  11. # a(18) > 56425348
  12. var arr = [1, 3, 4, 2, 11, 21, 30, 216, 118, 170, 1092, 8484, 97104, 96720, 493170, 251496, 1380652, 12137510]
  13. var n = arr.len
  14. var root = arr.join
  15. for k in (1..1e10) {
  16. say "Testing: #{k}"
  17. if (Num(root + k).is_omega_prime(n)) {
  18. if (!arr.contains(k)) {
  19. die "Found: a(#{n}) = #{k}"
  20. }
  21. }
  22. }
  23. __END__
  24. Found: a(15) = 251496 at x.sf line 11
  25. sidef prog.sf 22.22s user 1.92s system 60% cpu 39.830 total
  26. Found: a(16) = 1380652 at x.sf line 17
  27. sidef prog.sf 129.03s user 7.41s system 78% cpu 2:54.64 total
  28. Found: a(17) = 12137510 at x.sf line 18
  29. sidef prog.sf 1574.01s user 52.04s system 93% cpu 28:53.32 total