https://github.com/jwerle/lucas-series
Lucas number series generator
https://github.com/jwerle/lucas-series
lucas number series
Last synced: 2 months ago
JSON representation
Lucas number series generator
- Host: GitHub
- URL: https://github.com/jwerle/lucas-series
- Owner: jwerle
- License: mit
- Created: 2018-04-06T13:31:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-07T20:02:15.000Z (about 7 years ago)
- Last Synced: 2025-01-17T01:24:36.221Z (4 months ago)
- Topics: lucas, number, series
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lucas-series
============## Install
```sh
$ npm install lucas-series
```## Usage
```js
const lucas = require('lucas-series')
const series = [...lucas(0, 5)] // 2 1 3 4 7for (const n of lucas(5, 10)) { console.log(n) }
// prints:
// 11
// 18
// 29
// 47
// 76```
## API
### `lucas(seed = 0, max = Infinity)`
Returns an object conforming to the
[Iteration Protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)
interface that will **yield** a [Lucas Number](https://en.wikipedia.org/wiki/Lucas_number).
This iterable lucas series can be initialized with a seed `n` value and
a max interval value in the series defaulting to `0` and `Infinity`
respectively.## License
MIT