download_graphs.sf 700 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/ruby
  2. # Download graphs for Aliquot sequences from factordb.com.
  3. # See also:
  4. # https://oeis.org/A216072
  5. # https://members.loria.fr/PZimmermann/records/aliquot.html
  6. var data = [
  7. 276, 552, 564, 660, 966, 1074, 1134, 1464, 1476, 1488,
  8. 1512, 1560, 1578, 1632, 1734, 1920, 1992, 2232, 2340,
  9. 2360, 2484, 2514, 2664, 2712, 2982, 3270, 3366, 3408,
  10. 3432, 3564, 3678, 3774, 3876, 3906, 4116, 4224, 4290,
  11. 4350, 4380, 4788, 4800, 4842,
  12. ]
  13. var dir = Dir("graphs")
  14. dir.exists || dir.create
  15. data.each {|n|
  16. var file = dir+File("#{n}.png")
  17. var url = "http://factordb.com/aliquot.php?type=1&aq=#{n}&big=1"
  18. next if file.exists
  19. Sys.run('wget', '-O', file, url)
  20. }