-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.sf
60 lines (55 loc) · 1.36 KB
/
verify.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
#!/usr/bin/ruby
# Positions of records in A306440.
# https://oeis.org/A307221
# Where A306440(n) is defined as:
# Number of different ways of expressing 2*n as (p - 1)*(q - 1), where p < q are primes
var h = Hash(
"58" => 151351200,
"59" => 518918400,
"60" => 441080640,
"61" => 475009920,
"62" => 474692400,
"63" => 454053600,
"64" => 275675400,
"65" => 537213600,
"66" => 1300622400,
"67" => 882161280,
"68" => 918918000,
"69" => 1232431200,
"70" => 735134400,
"71" => 1102701600,
"72" => 2259457200,
"73" => 821620800,
"74" => 2035756800,
"75" => 1187524800,
"76" => 1403438400,
"77" => 1881079200,
"78" => 3223281600,
"79" => 2095133040,
"80" => 2536213680,
"81" => 2875672800,
"82" => 3859455600,
"83" => 2205403200,
"84" => 2907122400,
"85" => 3760495200,
"86" => 4227022800,
"87" => 2940537600,
"88" => 6054048000,
"89" => 2572970400,
"90" => 6265939680,
"91" => 7764316560,
"92" => 6064858800,
"93" => 5329724400,
"94" => 5145940800,
"95" => 4929724800,
"98" => 5513508000,
"100" => 7718911200,
"102" => 7351344000,
"103" => 8821612800,
"104" => 9777287520,
"107" => 6446563200,
"110" => 8627018400,
)
# Extra terms after a(33):
# 275675400, 537213600, 735134400, 821620800, 1187524800, 1403438400, 1881079200
say h.keys.grep{Num(_)>77}.map{h{_}}.min