prog.sf 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/ruby
  2. # 13-smooth <= 10^n: https://oeis.org/A106629
  3. # 17-smooth <= 10^n: https://oeis.org/A108275
  4. # 19-smooth <= 10^n: https://oeis.org/A108276
  5. # 23-smooth <= 10^n: https://oeis.org/A108277
  6. func a(n,k) {
  7. k.smooth_count(10**n)
  8. }
  9. var k = 23
  10. say "\n# Number of #{k}-smooth numbers <= 10^n\n"
  11. for n in (0..100) {
  12. print(a(n, k), ", ")
  13. }
  14. __END__
  15. # Number of 13-smooth numbers <= 10^n
  16. 1, 10, 62, 242, 733, 1848, 4106, 8289, 15519, 27365, 45914, 73908, 114831, 173077, 254065, 364385, 511985, 706293, 958460, 1281500, 1690506, 2202871, 2838489, 3620013, 4573071, 5726533, 7112760, 8767880, 10732089, 13049906, 15770500, 18948010, 22641849, 26917042, 31844560, 37501701, 43972415, 51347717, 59726038, 69213627, 79924970, 91983183, 105520465, 120678490, 137608884, 156473667, 177445740, 200709298, 226460414, 254907431, 286271536, 320787247, 358702938, 400281420, 445800392, 495553105, 549848862, 609013592, 673390460, 743340492, 819243121, 901496834, 990519787, 1086750482, 1190648357, 1302694497, 1423392253, 1553267956, 1692871593, 1842777510, 2003585141, 2175919621
  17. # Number of 17-smooth numbers <= 10^n
  18. 1, 10, 67, 287, 945, 2579, 6179, 13389, 26809, 50351, 89679, 152751, 250420, 397227, 612185, 919814, 1351182, 1945205, 2750000, 3824456, 5239923, 7082118, 9453184, 12473898, 16286197, 21055745, 26974877, 34265658, 43183191, 54019174, 67105737, 82819464, 101585715, 123883288, 150249170, 181283788, 217656485, 260111170, 309472490, 366652211, 432655889, 508589973, 595669238, 695224492, 808710687, 937715529, 1083968125, 1249348499, 1435897064, 1645824773, 1881523565
  19. # Number of 19-smooth numbers <= 10^n
  20. 1, 10, 72, 331, 1169, 3419, 8751, 20198, 42950, 85411, 160626, 288126, 496303, 825326, 1330766, 2088013, 3197529, 4791093, 7039193, 10159603, 14427309, 20186026, 27861175, 37974797, 51162295, 68191379, 89983125, 117635672, 152450425, 195961031, 249965412, 316560990, 398183405, 497648635, 618199219, 763554332, 937964342, 1146269686, 1393964815, 1687266961, 2033190148, 2439625002
  21. # Number of 23-smooth numbers <= 10^n
  22. 1, 10, 76, 369, 1385, 4298, 11654, 28434, 63768, 133440, 263529, 495412, 892644, 1550012, 2605342, 4254753, 6771752, 10531080, 16038303, 23965659, 35195450, 50872227, 72464493, 101837746, 141340075, 193902062, 263152095, 353549942, 470539447, 620723159, 812060729, 1054093970, 1358200134, 1737877407