@stdlib/datasets-primes-100k
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.8 • Public • Published

    Prime Numbers

    NPM version Build Status Coverage Status dependencies

    The first 100,000 prime numbers.

    Installation

    npm install @stdlib/datasets-primes-100k

    Usage

    var primes = require( '@stdlib/datasets-primes-100k' );

    primes()

    Returns a list containing the first 100,000 prime numbers.

    var list = primes();
    // returns [ 2, 3, 5, ... ]

    Examples

    var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
    var primes = require( '@stdlib/datasets-primes-100k' );
    
    var list;
    var len;
    var idx;
    var i;
    
    list = primes();
    len = list.length;
    
    // Select random primes from the list...
    for ( i = 0; i < 100; i++ ) {
        idx = discreteUniform( 0, len-1 );
        console.log( list[ idx ] );
    }

    CLI

    Installation

    To use the module as a general utility, install the module globally

    npm install -g @stdlib/datasets-primes-100k

    Usage

    Usage: primes-100k [options]
    
    Options:
    
      -h,    --help                Print this message.
      -V,    --version             Print the package version.
    

    Examples

    $ primes-100k
    2
    3
    5
    ...

    License

    The data files (databases) are licensed under an Open Data Commons Public Domain Dedication & License 1.0 and their contents are licensed under Creative Commons Zero v1.0 Universal. The software is licensed under Apache License, Version 2.0.


    Notice

    This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

    For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

    Community

    Chat


    Copyright

    Copyright © 2016-2021. The Stdlib Authors.

    Install

    npm i @stdlib/datasets-primes-100k

    Homepage

    stdlib.io

    DownloadsWeekly Downloads

    36

    Version

    0.0.8

    License

    Apache-2.0

    Unpacked Size

    1.47 MB

    Total Files

    16

    Last publish

    Collaborators

    • stdlib-bot
    • kgryte
    • planeshifter
    • rreusser