-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog.sf
29 lines (20 loc) · 1.05 KB
/
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
#!/usr/bin/ruby
# a(1) = a(2) = 1, a(n) is largest prime factor of concatenation of a(n - 1) and a(n - 2)
# https://oeis.org/A??????
# Known terms:
# 1, 1, 11, 37, 1237, 123737, 137485693, 167222747, 2081671423703, 1958415594749, 303482242094117, 4990119769069, 1753396751617079, 40759155835799, 74215118911076383267, 33016962979727, 4327397624107603, 1172736483497995482430793983, 26874634395299330674234977494774877511, 2523062416141515665780410338151763581690335374467, 913943047004080117542463894580764339324379902288167286591, 175748407424528547616435213027339808901622742532279865475816027699425035215507294956463
include('../../../factordb/auto.sf')
func a(n) is cached {
return 1 if (n == 1)
return 1 if (n == 2)
gpf(Num(join('', a(n-1), a(n-2))))
}
var fh = File('bfile.txt').open_w
fh.autoflush(true)
for n in (1..10000) {
var row = "#{n} #{a(n)}"
say row
fh.say(row)
}
__END__
not FF: 175748407424528547616435213027339808901622742532279865475816027699425035215507294956463913943047004080117542463894580764339324379902288167286591