123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #!/usr/bin/ruby
- # Let a(n) be the smallest number k such that (b+1)^k - b^k is not squarefree for all b = 1..n.
- # 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.
- # 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.
- func f(n, from) {
- from..Inf -> first {|k|
- 1..n -> all {|b| is_prob_squarefree((b+1)**k - b**k) }
- }
- }
- var from = 0
- var prev = -1
- for k in (1..1000) {
- from = f(k, from+1)
- next if (from == prev)
- say "c(#{k}) = #{from}"
- prev = from
- }
- __END__
- # Let a(n) be the smallest number k such that (b+1)^k - b^k is not squarefree for all b = 1..n.
- # Term listed only where the value of k increases.
- a(1) = 6
- a(2) = 20
- a(5) = 42
- a(6) = 110
- a(10) = 156
- a(38) = 660
- a(44) = 930
- a(93) = 1640
- a(204) = 2530
- a(275) = 3660
- a(305) = 5460
- # 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.
- b(1) = 6
- b(2) = 20
- b(3) = 40
- b(4) = 42
- b(5) = 84
- b(6) = 110
- b(7) = 156
- b(8) = 220
- b(9) = 272
- b(10) = 312
- b(11) = 342
- b(12) = 420
- b(13) = 468
- b(14) = 506
- b(15) = 544
- b(16) = 624
- b(17) = 660
- b(18) = 684
- b(19) = 780
- b(20) = 812
- b(21) = 840
- b(22) = 930
- b(23) = 936
- b(24) = 1026
- b(25) = 1092
- b(26) = 1248
- b(27) = 1260
- b(28) = 1320
- b(29) = 1332
- b(30) = 1360
- b(31) = 1368
- b(32) = 1404
- b(33) = 1540
- b(34) = 1560
- b(35) = 1640
- b(36) = 1710
- b(37) = 1716
- b(38) = 1806
- b(39) = 1860
- b(40) = 1980
- b(41) = 2162
- b(42) = 2184
- # 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.
- c(1) = 1
- c(2) = 2
- c(3) = 3
- c(4) = 5
- c(5) = 7
- c(6) = 9
- c(7) = 13
- c(8) = 17
- c(9) = 19
- c(10) = 23
- c(11) = 25
- c(12) = 29
- c(13) = 31
- c(14) = 37
- c(15) = 41
- c(16) = 43
- c(17) = 47
- c(18) = 49
- c(19) = 59
- c(20) = 61
- c(21) = 67
- c(22) = 71
- c(23) = 73
- c(24) = 79
- c(25) = 83
- c(26) = 97
- c(27) = 101
- c(28) = 103
- c(29) = 107
- c(30) = 109
|