Leonardo numbers: Difference between revisions

(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 1,203:
=={{header|Mathematica}}==
 
<lang Mathematica>L[0,L0_:1,___]:=L0
{{incorrect|Mathematica| <br><br> The wrong formula is being used (the 4<sup>th</sup> formula is being used, instead, the 3<sup>rd</sup> formula is to be used. <br><br> Also, output is missing for the Fibonacci series calculated via the Leonardo series, the 3<sup>rd</sup> formula. <br><br>}}
L[1,L0_:1,L1_:1,___]:=L1
L[n_,L0_:1,L1_:1,add_:1]:=L[n-1,L0,L1,add]+L[n-2,L0,L1,add]+add
 
L/@(Range[25]-1)
<lang Mathematica>L[n_] := 2 Fibonacci[n + 1] - 1; L /@ Range[25]</lang>
L[#,0,1,0]&/@(Range[25]-1)</lang>
<pre>{1, 3, 5, 9, 15, 25, 41, 67, 109, 177, 287, 465, 753, 1219, 1973, 3193, 5167, 8361, 13529, 21891, 35421, 57313, 92735, 150049, 242785}</pre>
 
<pre>{1, 1, 3, 5, 9, 15, 25, 41, 67, 109, 177, 287, 465, 753, 1219, 1973, 3193, 5167, 8361, 13529, 21891, 35421, 57313, 92735, 150049, 242785}</pre>
{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368}</pre>
 
=={{header|min}}==