Sign in Join
Wiki copytemporary

Leonardo number/fi: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11# Leonardon numero
22
33Leonardon sarja on seuraavanlainen numerosarja:
44
5-`1, 1, 3, 5, 9, 15, 25 ...`
5+```text
6+1, 1, 3, 5, 9, 15, 25 ...
7+```
68
79## Leonardon numero rekursiivisellä tavalla
810
911``` pascal
1012function LeonardoNumber( n : integer ):integer;
1113begin
1214 if n > 1 then result := LeonardoNumber( n - 1 ) + LeonardoNumber( n - 2 ) + 1
1315 else result := 1;
1416end;
1517```
1618
1719## Leonardon numero käyttämällä [[Fibonacci number/fi|Fibonacin numeroa]]
1820
1921``` pascal
2022function LeonardoNumber2( n : integer ):integer;
2123begin
2224 result := 2 * FibonacciNumber( n + 1) - 1
2325end;
2426```
2527
2628---
2729*From the Free Pascal wiki, page "Leonardo number/fi", as it stood on 2020-02-19 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history