prog.pl 731 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/perl
  2. # Composite numbers that divide the reverse of the concatenation of their ascending order prime factors, with repetition.
  3. # https://oeis.org/A371696
  4. # Known terms:
  5. # 26, 38, 46, 378, 26579, 84941, 178838, 30791466, 39373022, 56405502, 227501395, 904085931
  6. # New terms:
  7. # 1657827142
  8. use 5.036;
  9. use ntheory qw(:all);
  10. # Next term is greater than:
  11. my $from = 11062000000;
  12. forfactored {
  13. if ($_ % 1e6 == 0) {
  14. say "Testing: $_";
  15. }
  16. if (@_ > 1 and modint(scalar reverse(join('', @_)), $_) == 0) {
  17. die "Found new term: $_\n";
  18. }
  19. } $from, 1e12;
  20. __END__
  21. Testing: 1656000000
  22. Testing: 1657000000
  23. Found new term: 1657827142
  24. perl prog.pl 585.29s user 0.29s system 99% cpu 9:49.90 total