prog.pl 790 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/perl
  2. # Numbers k such that the k-th triangular number mod the sum (with multiplicity) of prime factors of k, and the k-th triangular number mod the sum of divisors of k, are the same prime
  3. # https://oeis.org/A353002
  4. # Known terms:
  5. # 93, 2653, 30433, 1922113, 15421122, 28776673, 240409057, 611393953
  6. # New terms found:
  7. # 2713190397, 5413336381
  8. # No other terms < 6074000999.
  9. use 5.020;
  10. use strict;
  11. use warnings;
  12. use ntheory qw(:all);
  13. use experimental qw(signatures);
  14. local $| = 1;
  15. my $from = 611393953-10;
  16. my $triangle = mulint($from, $from+1)>>1;
  17. forfactored {
  18. $triangle = addint($triangle, $_);
  19. my $p = modint($triangle, vecsum(@_));
  20. if (is_prime($p) and (modint($triangle, divisor_sum($_)) == $p)) {
  21. print $_, ", ";
  22. }
  23. } $from+1, 1e10;