search.sf 583 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/ruby
  2. # Numbers k such that A003415(sigma(k)) = k, where A003415 is the arithmetic derivative, and sigma is the sum of divisors of n.
  3. # https://oeis.org/A342021
  4. # Known terms:
  5. # 5, 8, 41, 47057
  6. var min = 1e8
  7. var max = 1e9
  8. for n in (5..100) {
  9. var count = n.squarefree_almost_prime_count(min, max) || break
  10. say "\nTesting: n = #{n} (count: #{count})\n"
  11. n.each_squarefree_almost_prime(min, max, {|p|
  12. var d = p.derivative
  13. p.inverse_sigma.each {|k|
  14. if (d == k) {
  15. print(k, ", ")
  16. }
  17. }
  18. })
  19. }