extra.sf 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/usr/bin/ruby
  2. # Let a(n) be the smallest number k such that (b+1)^k - b^k is not squarefree for all b = 1..n.
  3. # Let b(n) be the smallest number k greater than b(n-1) such that (r+1)^k - r^k is not squarefree for all r = 1..n, with b(1) = 6.
  4. # Let c(n) be the smallest number k greater than c(n-1) such that (r+1)^k - r^k is squarefree for all r = 1..n, with c(1) = 1.
  5. func f(n, from) {
  6. from..Inf -> first {|k|
  7. 1..n -> all {|b| is_prob_squarefree((b+1)**k - b**k) }
  8. }
  9. }
  10. var from = 0
  11. var prev = -1
  12. for k in (1..1000) {
  13. from = f(k, from+1)
  14. next if (from == prev)
  15. say "c(#{k}) = #{from}"
  16. prev = from
  17. }
  18. __END__
  19. # Let a(n) be the smallest number k such that (b+1)^k - b^k is not squarefree for all b = 1..n.
  20. # Term listed only where the value of k increases.
  21. a(1) = 6
  22. a(2) = 20
  23. a(5) = 42
  24. a(6) = 110
  25. a(10) = 156
  26. a(38) = 660
  27. a(44) = 930
  28. a(93) = 1640
  29. a(204) = 2530
  30. a(275) = 3660
  31. a(305) = 5460
  32. # Let b(n) be the smallest number k greater than b(n-1) such that (r+1)^k - r^k is not squarefree for all r = 1..n, with b(1) = 6.
  33. b(1) = 6
  34. b(2) = 20
  35. b(3) = 40
  36. b(4) = 42
  37. b(5) = 84
  38. b(6) = 110
  39. b(7) = 156
  40. b(8) = 220
  41. b(9) = 272
  42. b(10) = 312
  43. b(11) = 342
  44. b(12) = 420
  45. b(13) = 468
  46. b(14) = 506
  47. b(15) = 544
  48. b(16) = 624
  49. b(17) = 660
  50. b(18) = 684
  51. b(19) = 780
  52. b(20) = 812
  53. b(21) = 840
  54. b(22) = 930
  55. b(23) = 936
  56. b(24) = 1026
  57. b(25) = 1092
  58. b(26) = 1248
  59. b(27) = 1260
  60. b(28) = 1320
  61. b(29) = 1332
  62. b(30) = 1360
  63. b(31) = 1368
  64. b(32) = 1404
  65. b(33) = 1540
  66. b(34) = 1560
  67. b(35) = 1640
  68. b(36) = 1710
  69. b(37) = 1716
  70. b(38) = 1806
  71. b(39) = 1860
  72. b(40) = 1980
  73. b(41) = 2162
  74. b(42) = 2184
  75. # Let c(n) be the smallest number k greater than c(n-1) such that (r+1)^k - r^k is squarefree for all r = 1..n, with c(1) = 1.
  76. c(1) = 1
  77. c(2) = 2
  78. c(3) = 3
  79. c(4) = 5
  80. c(5) = 7
  81. c(6) = 9
  82. c(7) = 13
  83. c(8) = 17
  84. c(9) = 19
  85. c(10) = 23
  86. c(11) = 25
  87. c(12) = 29
  88. c(13) = 31
  89. c(14) = 37
  90. c(15) = 41
  91. c(16) = 43
  92. c(17) = 47
  93. c(18) = 49
  94. c(19) = 59
  95. c(20) = 61
  96. c(21) = 67
  97. c(22) = 71
  98. c(23) = 73
  99. c(24) = 79
  100. c(25) = 83
  101. c(26) = 97
  102. c(27) = 101
  103. c(28) = 103
  104. c(29) = 107
  105. c(30) = 109