<div dir="ltr"><div>If I may, I'd like to reference the paper by Jerzy Kaczmarczuk: "Generating power of lazy semantics": <a href="https://karczmarczuk.users.greyc.fr/arpap/lazysem.pdf">https://karczmarczuk.users.greyc.fr/arpap/lazysem.pdf</a><br><br></div><div>It defines much more than Fibonacci numbers using similar techniques and beyond.</div><div><br></div><div>Techniques there allow expression of multibody dynamics from Lagrangian. This gives a solution to such problems with time power series. This is not a closed form solution, yet very useful one.<br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">вс, 19 янв. 2025 г. в 15:45, Vanessa McHale <<a href="mailto:vamchale@gmail.com">vamchale@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Laziness turns out to allow course-of-value recursion where one might use memoization in other languages. But I hadn’t seen this articulated!<div><br></div><div>Famously, one can use this to define the Fibonacci numbers, viz.</div><div><br></div><div><font face="Monaco">fibs :: [Integer]</font></div><div><font face="Monaco">fibs = 1 : 1: zipWith (+) fibs (tail fibs)</font></div><div><br></div><div>Or the Catalan numbers:</div><div><br></div><div><div><font face="Monaco">catalan :: [Integer]</font></div><div><font face="Monaco">catalan = 1 : 1 : [ sum [ (-1)^(k+1) * (pc (n - ((k*(3*k-1)) /. 2)) + pc (n - ((k*(3*k+1))/.2))) | k <- [1..n] ] | n <- [2..] ]</font></div><div><font face="Monaco">  where</font></div><div><font face="Monaco">    pc m | m >= 0 = part !! m | otherwise = 0</font></div><div><font face="Monaco"><br></font></div><div><font face="Monaco">    infixl 6 /.</font></div><div><font face="Monaco">    (/.) = quot</font></div><div><div><br></div><div>I wrote up the example: <a href="http://vmchale.com/static/serve/Comb.pdf" target="_blank">http://vmchale.com/static/serve/Comb.pdf</a></div></div><div><br></div><div>Reinhard Zumkeller has a lot of examples on OEIS: <a href="https://oeis.org/A000081" target="_blank">https://oeis.org/A000081</a></div></div><div><br></div><div>Cheers,</div><div>Vanessa McHale</div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>