search.pl 352 B

12345678910111213141516171819
  1. #!/usr/bin/perl
  2. # a(n) is the least integer such that sigma(sigma(k)) >= n*k where sigma is A000203, the sum of divisors.
  3. # https://oeis.org/A327630
  4. use 5.014;
  5. use strict;
  6. use warnings;
  7. use ntheory qw(:all);
  8. my $n = 1;
  9. for my $k (1 .. 1e10) {
  10. while (divisor_sum(divisor_sum($k, 1)) >= $k * $n) {
  11. say "a($n) = $k";
  12. ++$n;
  13. }
  14. }