Sign in Join
Wiki copytemporary

Leonardo number/fr: what changed

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

OldNewLine
11# Nombre de Léonard
22
33La suite de Léonard est la suivante :
44
5-`1, 1, 3, 5, 9, 15, 25 ...`
5+```text
6+1, 1, 3, 5, 9, 15, 25 ...
7+```
68
79Chaque est la somme de ses prédécesseurs + 1, les premiers termes sont 1 et 1.
810
911## Méthode récursive
1012
1113``` pascal
1214function LeonardoNumber( n : integer ):integer;
1315begin
1416 if n > 1 then result := LeonardoNumber( n - 1 ) + LeonardoNumber( n - 2 ) + 1
1517 else result := 1;
1618end;
1719```
1820
1921## Emploi du [[Fibonacci number/fr|nombre de Fibonacci]]
2022
2123``` pascal
2224function LeonardoNumber2( n : integer ):integer;
2325begin
2426 result := 2 * FibonacciNumber( n + 1) - 1
2527end;
2628```
2729
2830---
2931*From the Free Pascal wiki, page "Leonardo number/fr", 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