-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog.sf
24 lines (16 loc) · 819 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
#!/usr/bin/ruby
# Largest prime factor of 10^(6*n) + 1.
# https://oeis.org/A072848
include('../../../factordb/auto.sf')
func a(n) is cached {
10**(6*n) + 1
}
var fh = File('bfile.txt').open_w
fh.autoflush(true)
for n in (1..10000) {
var row = "#{n} #{gpf(a(n))}"
say row
fh.say(row)
}
__END__
not FF: 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001