-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprog.sf
70 lines (59 loc) · 912 Bytes
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/ruby
# Least number k such that (10^k-1)/3 has exactly n distinct prime factors.
# Cf. A002277.
# Known terms:
# 1, 2, 4, 13, 6, 15, 12, 18, 28, 24, 36, 32, 30, 42, 78, 64, 72, 100, 128, 60, 84, 96, 150, 126, 160, 120, 204, 315, 168, 192, 306, 180, 210, 240, 252, 330
# This sequence provides upper-bounds for A360301:
# A360301(n) <= (10^a(n)-1)/3.
# Lower-bounds:
# a(37) > 352.
include("../../../factordb/auto.sf")
Num!VERBOSE = true
func a(n) {
for k in (1..Inf) {
var t = ((10**k - 1)/3)
if (try { omega(t) == n } catch { t.is_omega_prime(n) }) {
return k
}
}
}
for n in (37..100) {
say "#{n} #{a(n)}"
}
__END__
1 1
2 2
3 4
4 13
5 6
6 15
7 12
8 18
9 28
10 24
11 36
12 32
13 30
14 42
15 78
16 64
17 72
18 100
19 128
20 60
21 84
22 96
23 150
24 126
25 160
26 120
27 204
28 315
29 168
30 192
31 306
32 180
33 210
34 240
35 252
36 330