|
|
|
|
|
by vmchale
435 days ago
|
|
in Haskell you can read off the generating function's coefficients directly from the functional equation T(z) = z + zT + zT² + zT² ghci> ts=0:(1+ts+ts^2+ts^3)
ghci> take 12 ts
[0,1,1,2,5,13,36,104,309,939,2905,9118] Using the Num instance for power series (very cute application of laziness expounded by Karczmarczuk and then McIlroy https://dl.acm.org/doi/abs/10.1017/s0956796899003299) |
|