123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/usr/bin/ruby
- # 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.
- # https://oeis.org/A366896
- # Known terms:
- # 1, 3, 4, 2, 11, 21, 30, 216, 118, 170, 1092, 8484, 97104, 96720, 493170
- # New terms:
- # a(15) = 251496
- # a(16) = 1380652
- # a(17) = 12137510
- # Lower-bounds:
- # a(18) > 56425348
- var arr = [1, 3, 4, 2, 11, 21, 30, 216, 118, 170, 1092, 8484, 97104, 96720, 493170, 251496, 1380652, 12137510]
- var n = arr.len
- var root = arr.join
- for k in (1..1e10) {
- say "Testing: #{k}"
- if (Num(root + k).is_omega_prime(n)) {
- if (!arr.contains(k)) {
- die "Found: a(#{n}) = #{k}"
- }
- }
- }
- __END__
- Found: a(15) = 251496 at x.sf line 11
- sidef prog.sf 22.22s user 1.92s system 60% cpu 39.830 total
- Found: a(16) = 1380652 at x.sf line 17
- sidef prog.sf 129.03s user 7.41s system 78% cpu 2:54.64 total
- Found: a(17) = 12137510 at x.sf line 18
- sidef prog.sf 1574.01s user 52.04s system 93% cpu 28:53.32 total
|