-
Notifications
You must be signed in to change notification settings - Fork 0
/
akiyama-tanigawa_numerators.sf
25 lines (19 loc) · 1.78 KB
/
akiyama-tanigawa_numerators.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
#!/usr/bin/ruby
# The unreduced numerators produced by the Akiyama–Tanigawa algorithm.
# The corresponding unreduced denominators are:
# https://oeis.org/A064320
# Example:
# bernoulli(n) = akiyama_tanigawa_numerator(n) / Prod_{k=2..n+1} k^binomial(n, k-1)
func akiyama_tanigawa_numerator(n) {
n.bernfrac * prod(2..(n+1), {|k| k**binomial(n, k-1) })
}
for n in (0..10 -> by(2)) {
say "A(#{n}) = #{akiyama_tanigawa_numerator(n).abs.factor_exp} = #{akiyama_tanigawa_numerator(n)}"
}
__END__
A(0) = [] = 1
A(2) = [[2, 1]] = 2
A(4) = [[2, 11], [3, 5]] = -497664
A(6) = [[2, 51], [3, 20], [5, 15]] = 239609999527967195136000000000000000
A(8) = [[2, 199], [3, 85], [5, 69], [7, 28]] = -22488019432655947294586954838400753261235046040984100580870030674321006065067975174876421496694774956032000000000000000000000000000000000000000000000000000000000000000000000
A(10) = [[2, 871], [3, 386], [5, 221], [7, 210]] = 20365257530918016171039056001495283122906935375511621880937985285541368957251236512682327909990112153849262228719316998217599272439458747323536731851414642636432448263703122571698861175490069815698104764675945775839382072046627151681800069326017346945224612080463443188802561045025518519287776438753210636201461443257757332000981973116850724254395705822262814809408842731863277702200645974274119109818626996367781903697874837091937872569655899718801790772307704771607635081669632024064847422349647168621736312036578982794202420561798986849926832723350414950400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000