/
3^k - 2^k -- prog.sf
55 lines (41 loc) · 1.53 KB
/
3^k - 2^k -- prog.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
#!/usr/bin/ruby
# Numbers n such that 3^n - 2^n is not squarefree, but 3^d - 2^d is squarefree for all proper divisors d of n.
# https://oeis.org/A280203
func f(k) {
k.divisors.first(-1).grep{_ < 150}.all {|d|
#is_prob_squarefree(2**d - 1, 1e8)
is_squarefree(3**d - 2**d)
}
}
#~ From ~~~~: (Start)
#~ The following numbers are also in the sequence: {689, 732, 776, 903, 1055, 1081, 1332, 2525, 2628, 13861}.
#~ Probably, the following numbers are also terms: {2054, 3422, 6416, 6482, 6516, 6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 14878, 15657, 15922}. (End)
# Smooth 10^4
# 10, 11, 42, 52, 57, 203, 272, 497, 689, 732, 776, 903, 1055, 1081, 1332, 2054, 2525, 2628, 3422, 6416, 6482, 6516, 6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 13861, 14878, 15657, 15922
# Smooth 10^7
# 10, 11, 42, 52, 57, 203, 272, 497, 689, 732, 776, 903, 1055, 1081, 1332, 2054, 2525, 2628, 3422, 6416, 6482, 6516, 6806
for k in (
6806, 9591, 9653, 10386, 10506, 11026, 11342, 11772, 12656, 13203, 13861, 14878, 15657, 15922,
) {
var t = (3**k - 2**k)
if (!t.is_prob_squarefree(1e7) && f(k)) {
say k
}
else {
say "Counter-example: #{k}"
}
}
__END__
func f(k) {
k.divisors.first(-1).all {|d|
is_prob_squarefree(3**d - 2**d)
}
}
for k in (1..30000
) {
var t = (3**k - 2**k)
if (!t.is_prob_squarefree(1e6) && !t.is_prob_squarefree && f(k)) {
print(k, ", ")
}
}
6, 20, 21, 110, 136, 155, 253, 364, 602, 657, 812, 889, 979, 1081,