Leonardo numbers: Difference between revisions
→{{header|Odin}}
Space Ghost (talk | contribs) (Leonardo Numbers written in Odin) |
Space Ghost (talk | contribs) |
||
Line 1,756:
=={{header|Odin}}==
<syntaxhighlight lang="Go">
package main
/* imports */
import "core:fmt"
/* main */
main :: proc() {
}
/* definitions */
leonardo :: proc(n, l0, l1, add: int) -> []int {
leo[0] = l0
for i in 2
leo[i] = leo[i -
}
▲ return leo
}
</syntaxhighlight>
{{out}}
<pre>
The first 25 Leonardo numbers with L[0] = 1, L[1] = 1 and add number = 1 are:
[
The first 25 Leonardo numbers with L[0] = 0, L[1] = 1 and add number = 0 are:
[
</pre>
|