time-to-botec/js/node_modules/@stdlib/math/base/special/nonfibonacci/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

4.0 KiB
Raw Blame History

Non-Fibonacci

Compute the nth non-Fibonacci number.

The nth non-Fibonacci number is given by

Formula to compute the nth non-Fibonacci number.

where φ is the golden ratio.

Usage

var nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' );

nonfibonacci( n )

Computes the nth non-Fibonacci number.

var v = nonfibonacci( 1 );
// returns 4

v = nonfibonacci( 2 );
// returns 6

v = nonfibonacci( 3 );
// returns 7

If provided either a non-integer or n < 1, the function returns NaN.

var v = nonfibonacci( -1 );
// returns NaN

v = nonfibonacci( 3.14 );
// returns NaN

If provided NaN, the function returns NaN.

var v = nonfibonacci( NaN );
// returns NaN

Examples

var nonfibonacci = require( '@stdlib/math/base/special/nonfibonacci' );

var v;
var i;

for ( i = 1; i < 100; i++ ) {
    v = nonfibonacci( i );
    console.log( 'nonfibonacci(%d) = %d', i, v );
}

References