Portability | Portable |
---|---|
Stability | Stable |
Maintainer | justin.hanekom@gmail.com |
Safe Haskell | Safe |
Provides the first 1001 Fibonacci numbers, retrieved from the Gutenberg Project, along with functions to retrieve and query these numbers.
Examples:
ghci> fibsLen 1001 ghci> fibsUpTo 5 [1, 1, 2, 3, 5] ghci> isFib 21 True ghci> isFib 23 False ghci> nthFib 6 8
Changes in 1.0.5:
- Updated and expanded documentation using Haddock markup
Documentation
The fibsLen
function returns the number of Fibonacci numbers in the
first1001Fibs
list.
As this list is based on the list of the first 1001 Fibonacci numbers as retrieved from the Gutenberg Project at http://www.ibiblio.org/pub/docs/books/gutenberg/etext01/fbncc10.txt it will be equal to 1001.
If a subsequent version of this module uses a new, expanded list from the Gutenberg Project then this number will change accordingly.
first1001Fibs :: [Integer]Source
first1001Fibs
is a list of the first 1001 Fibonacci numbers.
This list was retrieved from the Gutenberg Project at http://www.ibiblio.org/pub/docs/books/gutenberg/etext01/fbncc10.txt
The first Fibonacci number in this list is 1
.
The last Fibonacci number in this list is 70,330,367,711,422,815,821,835,254,877,183,549,770,181,269,836,358,732,742,604,905,087,154,537,118,196,933,579,742,249,494,562,611,733,487,750,449,241,765,991,088,186,363,265,450,223,647,106,012,053,374,121,273,867,339,111,198,139,373,125,598,767,690,091,902,245,245,323,403,501
.
The lastFib
function returns the last Fibonacci number in the list
of Fibonacci numbers, first1001Fibs
.
The last Fibonacci number in this list is 70,330,367,711,422,815,821,835,254,877,183,549,770,181,269,836,358,732,742,604,905,087,154,537,118,196,933,579,742,249,494,562,611,733,487,750,449,241,765,991,088,186,363,265,450,223,647,106,012,053,374,121,273,867,339,111,198,139,373,125,598,767,690,091,902,245,245,323,403,501
.
The nthFib
function returns the nth Fibonacci number.
An error is thrown if the index number given is less than one (1) or greater
than the number of Fibonacci numbers in the first1001Fibs
list, i.e.,
fibsLen
.