-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog.sf
29 lines (19 loc) · 791 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
#!/usr/bin/ruby
# Number of distinct prime factors of sigma_n(n).
# https://oeis.org/A352420
include("../../../factordb/auto.sf")
func a(n) {
var f = sigma_factors(n, n)
#var f = sigma_factors_symbolic(n, n)
f.map { FF_factordb(_) }.flat.uniq.len
}
for n in (1..1000) {
#print(a(n), ", ")
say "#{n} #{a(n)}"
}
__END__
# First 100 terms:
0, 1, 2, 3, 3, 4, 3, 2, 3, 5, 6, 8, 5, 5, 8, 6, 3, 8, 5, 11, 9, 7, 8, 10, 8, 8, 10, 12, 7, 13, 7, 11, 15, 10, 15, 11, 7, 8, 11, 10, 6, 14, 8, 14, 14, 11, 10, 17, 6, 21, 15, 16, 8, 18, 16, 15, 16, 6, 9, 22, 8, 10, 17, 13, 17, 17, 7, 17, 20, 17, 8, 23, 4, 13, 21, 16, 19, 21, 7, 22, 12, 8, 12, 29, 15, 8, 21, 15, 6, 32, 19, 16, 20, 12, 23, 26, 8, 19, 22, 32
a(67)-a(75) from ~~~~
# PARI/GP program:
a(n) = omega(sigma(n, n));