This site is supported by donations to The OEIS Foundation.
Template:Lucas
From OeisWiki
The following documentation is located at Template:Lucas/doc. [<Edit> Template:Lucas/doc]
[⧼Purge⧽ Template:Lucas]
The {{Lucas}} mathematical function template returns the [⧼Purge⧽ Template:Lucas]
n |
n |
Contents
Usage
- {{Lucas|integer}}
Valid input
An integer argument.
Examples
Examples with valid input
Code Result {{Lucas|-5}} -11 {{Lucas|-4}} 7 {{Lucas|-3}} -4 {{Lucas|-2}} 3 {{Lucas|-1}} -1 {{Lucas|0}} 2 {{Lucas|1}} 1 {{Lucas|2}} 3 {{Lucas|3}} 4 {{Lucas|4}} 7 {{Lucas|5}} 11 {{Lucas|8}} 47 {{Lucas|10}} 123
Examples with invalid input
Code Result (returns an error message) {{Lucas}} Lucas error: Argument must be an integer {{Lucas|3.25}} Lucas error: Argument must be an integer {{Lucas|rabbits}} Lucas error: Argument must be an integer
Code
{{ifint| ( {{{1|NAN}}} ) | {{#expr: ( ((1 + 5^(1/2)) / 2)^( {{{1}}} ) + ((1 - 5^(1/2)) / 2)^( {{{1}}} ) ) round 0 }} | {{error| Lucas error: Argument must be an integer }} }}
See also
- {{Fibonacci}}
- {{Lucas}}
- {{Golden ratio}} or {{phi}}