# iterNonFibonacciSeq > Create an iterator which generates a [non-Fibonacci integer sequence][fibonacci-number].
The nth [non-Fibonacci number][fibonacci-number] is given by
Formula to compute the nth non-Fibonacci number.
where `φ` is the [golden ratio][golden-ratio].
## Usage ```javascript var iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); ``` #### iterNonFibonacciSeq( \[options] ) Returns an iterator which generates a [non-Fibonacci integer sequence][fibonacci-number]. ```javascript var it = iterNonFibonacciSeq(); // returns var v = it.next().value; // returns 4 v = it.next().value; // returns 6 v = it.next().value; // returns 7 // ... ``` The returned iterator protocol-compliant object has the following properties: - **next**: function which returns an iterator protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the iterator is finished. - **return**: function which closes an iterator and returns a single (optional) argument in an iterator protocol-compliant object. The function supports the following `options`: - **iter**: number of iterations. Default: `1e308`. By default, the function returns an infinite iterator (i.e., an iterator which never ends). To limit the number of iterations, set the `iter` option. ```javascript var opts = { 'iter': 2 }; var it = iterNonFibonacciSeq( opts ); // returns var v = it.next().value; // returns 4 v = it.next().value; // returns 6 var bool = it.next().done; // returns true ```
## Notes - If an environment supports `Symbol.iterator`, the returned iterator is iterable.
## Examples ```javascript var iterNonFibonacciSeq = require( '@stdlib/math/iter/sequences/nonfibonacci' ); // Create an iterator: var opts = { 'iter': 100 }; var it = iterNonFibonacciSeq( opts ); // Perform manual iteration... var v; while ( true ) { v = it.next(); if ( v.done ) { break; } console.log( v.value ); } ```
* * *
## References - Gould, H.W. 1965. "Non-Fibonacci Numbers." _Fibonacci Quarterly_, no. 3: 177–83. [<http://www.fq.math.ca/Scanned/3-3/gould.pdf>][@gould:1965a]. - Farhi, Bakir. 2011. "An explicit formula generating the non-Fibonacci numbers." _arXiv_ abs/1105.1127 \[Math.NT] (May): 1–5. [<https://arxiv.org/abs/1105.1127>][@farhi:2011a].