-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblandin-diaz_compositional_bernoulli_numbers_B_Z_1_2.sf
64 lines (54 loc) · 3.33 KB
/
blandin-diaz_compositional_bernoulli_numbers_B_Z_1_2.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
61
62
63
64
#!/usr/bin/ruby
# Author: Daniel "Trizen" Șuteu
# Date: 24 February 2018
# https://github.com/trizen
# A new recurrence for computing Blandin-Diaz compositional Bernoulli numbers (B^Z)_1,n.
# Formula:
# a(0) = 1
# a(n) = -(Sum_{k=0..n-1} a(k) * binomial(n+1, k) / (n-k+1)) / (n+1)
# Which gives us the nth Blandin-Diaz compositional Bernoulli number as:
# (B^Z)_1,n = a(n)
# See also:
# https://arxiv.org/abs/0708.0809
# OEIS entries:
# https://oeis.org/A132096 (numerators)
# https://oeis.org/A132097 (denominators)
func a((0)) { 1 }
func a(n) is cached {
-sum(^n, {|k| a(k) * binomial(n+1, k) / (n - k + 1) }) / (n+1)
}
for n in (0..30) {
printf("(B^Z)_1(%2d) = %50s / %s\n", n, a(n) -> nude)
}
__END__
(B^Z)_1( 0) = 1 / 1
(B^Z)_1( 1) = -1 / 4
(B^Z)_1( 2) = 1 / 72
(B^Z)_1( 3) = 1 / 96
(B^Z)_1( 4) = 61 / 21600
(B^Z)_1( 5) = -1 / 640
(B^Z)_1( 6) = -12491 / 5080320
(B^Z)_1( 7) = -479 / 580608
(B^Z)_1( 8) = 530629 / 326592000
(B^Z)_1( 9) = 54979 / 20736000
(B^Z)_1(10) = 1039405 / 2529128448
(B^Z)_1(11) = -4981183 / 1094860800
(B^Z)_1(12) = -9055875786121 / 1298164008960000
(B^Z)_1(13) = 908993573959 / 399435079680000
(B^Z)_1(14) = 288260975797477 / 11298306539520000
(B^Z)_1(15) = 7874837285353 / 231760134144000
(B^Z)_1(16) = -2255621632465386299 / 48978158848819200000
(B^Z)_1(17) = -189404901989770501 / 768284844687360000
(B^Z)_1(18) = -20038592583515962234111 / 81541143706048266240000
(B^Z)_1(19) = 954329155426992424481 / 1009797445276139520000
(B^Z)_1(20) = 1731149375200514221429374109 / 467359502609929273344000000
(B^Z)_1(21) = 8016281400739796361657439 / 4685308296841396224000000
(B^Z)_1(22) = -1964113542866695843598946823499 / 77059691495268338368512000000
(B^Z)_1(23) = -118691634224452471169536026691 / 1489076164159774654464000000
(B^Z)_1(24) = 135434809276184922849073184461382701 / 4161725903949894195845529600000000
(B^Z)_1(25) = 26583901529200186483827848422605931 / 28951136723129698753708032000000
(B^Z)_1(26) = 2091948019281596823581094063056026741 / 921982354105822714156548096000000
(B^Z)_1(27) = -17184038039286229015503662725836073 / 3902570811029937414419251200000
(B^Z)_1(28) = -8419050697190151468948558716310571435121 / 194332621504510501906179686400000000
(B^Z)_1(29) = -13029523224822054632420243355173393801041 / 169761830279802277527237427200000000
(B^Z)_1(30) = 277675025860127837282124790366392259270502106569 / 696429859645093494977344849204740096000000