prog2.pl 430 B

123456789
  1. #!/usr/bin/perl
  2. # https://oeis.org/A305058
  3. # More terms:
  4. # 6, 12, 80, 160, 312, 352, 928, 1760, 1792, 3264, 3960, 7104, 7648, 13680, 15984, 16224, 17760, 19712, 20352, 20800, 21088, 22368, 23184, 25728, 25888, 26240, 27072, 29664, 47952, 57312, 60048, 62976, 67072, 73152, 74368, 77664, 78144, 81568, 85056, 85392, 86688
  5. use ntheory ':all'; for (1..10**5) { print "$_\n" if inverse_totient($_) == divisor_sum($_, 0) } # ~~~~