ajs / perl6-Math-Sequences

Useful mathematical sequences
Artistic License 2.0
3 stars 9 forks source link

A000793 / Landau implementation is correct but too slow #48

Open AlexDaniel opened 5 years ago

AlexDaniel commented 5 years ago

https://oeis.org/A000793

Currently when running tests:

Timeout in A000793
  in block  at t/OEIS.t6 line 894
ok 72 - A000793

It seems like the test passes but it still gives a warning.

The implementation is fairly short:

# A000793 / Landau
our @A000793 is export = 1, { strict-partitions(++$).map({[lcm] $_}).max } ... *;

The test file seem to check 49 elements (@A000793[^48]) which on my computer takes 21 seconds to compute. Not great but not terrible. What should be done about it?

MasterDuke17 commented 5 years ago

Helped by https://github.com/ajs/perl6-Math-Sequences/pull/151, @A000793[^48] now takes 8.3s on my machine.