StringTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Combinatorics on Words : StringTools/Fibonacci

StringTools

  

Fibonacci

  

generate a Fibonacci string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Fibonacci( n, a, b )

Parameters

n

-

non-negative integer; specifies that Fibonacci return the nth Fibonacci string

a

-

character; (optional) first symbol to use

b

-

character; (optional) second symbol to use

Description

• 

The Fibonacci(n, a, b) generates the nth Fibonacci string, with initial values a and b. The arguments after the first are optional, and default to the strings 0 and 1, respectively.

• 

Given starting symbols a and b, the nth Fibonacci string is defined by the recurrence Fibonacci( n, a, b ) = cat( Fibonacci( n - 1, a, b ), Fibonacci( n - 2, a, b ) ), for 1<n, and the initial conditions Fibonacci( 0, a, b ) = b and Fibonacci( 1, a, b ) = a. The length of Fibonacci( n ) is equal to the nth+1 Fibonacci number.

• 

The Fibonacci procedure has option remember.

Examples

withStringTools&colon;

Fibonacci5

01001010

(1)

Fibonacci5&comma;u&comma;v

uvuuvuvu

(2)

seqlengthFibonaccii&comma;i&equals;1..10

1&comma;2&comma;3&comma;5&comma;8&comma;13&comma;21&comma;34&comma;55&comma;89

(3)

seqcombinat&lsqb;&apos;fibonacci&apos;&rsqb;1&plus;i&comma;i&equals;1..10

1&comma;2&comma;3&comma;5&comma;8&comma;13&comma;21&comma;34&comma;55&comma;89

(4)

See Also

combinat[fibonacci]

string

StringTools

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam