-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra.sf
116 lines (105 loc) · 1.97 KB
/
extra.sf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/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