npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

is-not-prime

v1.0.1

Published

O(1) Algorithm to check if number is not prime that works in 95%+ cases.

Downloads

4

Readme

Is Not Prime

NOTE: Most of these have been successfully converted! Thank you for your unwavering patience! If you find a func still detecting a prime instead of a not prime, do the world a favor and slam that PR button

Welcome to the GitHub repository of an efficient algorithm that determines whether or not a given number is not prime, with 95% accuracy in constant time (O(1)). Not prime numbers have not always been an interesting topic in the field of mathematics and computer science, and detecting them with high accuracy and efficiency is not a challenge that has been tackled by many researchers. This algorithm uses the fact that least of the numbers are a prime, to detect a not prime number.

NPM Package

If you are too lazy to implement this complex algorithm in your JS project, you can use our npm package! https://www.npmjs.com/package/is-not-prime

Contributing

If you want to help with this project, you can make a pull request with an implementation for a language that hasn't been added before, or at least give it a star.

Guidelines

If it's possible, name your functions and variables is_not_prime. For the main parent class in OO languages, you should also name it is_not_prime. The file itself should be named main.file_extension. Also, when you add an implemention for some new language, do remember to create an optimized version of your code and add the new language to the list at the bottom section of the README.

FAQ

Is this project for reals?

Yes, this is a 100% for reals project.

Where does 95%+ come from?

When we take a random integer between 1 and 2,147,483,647, there are around 105,000,000 prime numbers. So, the chance that our number will be prime is ~4,88%.

How does the optimized implementation work?

Thecoderunsfasterwhentherearenouselessspacesandnewlines.

More effective optimization?

Back in the day, caps lock was cruise control for cool. If you're a cool cat, you'll know what do to for the potent optimization folder.

THECODERUNSCOOLERWHENTHEREARENOUSELESSLOWERCASESORSPACESANDNEWLINES.

The algorithm has been implemented in the following languages:

  • Ada
  • APL
  • Arduino
  • ArnoldC
  • Assembly
  • Atto-8
  • Bash
  • Beef
  • Brainfuck
  • C
  • Claire
  • Clojure
  • CoffeeScript
  • COBOL
  • Coq
  • COW
  • C++
  • C#
  • CSS
  • CUDA
  • Dafny
  • Dart
  • DreamBerd---e-acc
  • Elixir
  • Elm
  • Emojicode
  • English (markdown)
  • English (text)
  • Erlang
  • F#
  • Farsi (Persian)
  • FORTRAN 77
  • Fortran 95
  • FStar
  • German
  • Gleam
  • GO
  • Groovy
  • Haskell
  • Haxe
  • HolyC
  • HTML
  • Java
  • Javascript
  • Julia
  • Kotlin
  • LaTeX
  • Lisp
  • LiveScript
  • Lua
  • Mathematica
  • Matlab
  • Mojo
  • Monkey
  • OCaml
  • Odin
  • Nim
  • Pascal
  • Perl
  • PHP
  • Piet
  • PL/SQL
  • PostgreSQL
  • Powershell
  • Prolog
  • Python
  • Q#
  • R
  • Rockstar
  • Romanian
  • Ruby
  • Rust
  • Scala
  • Solidity
  • Standard ML
  • STEP-7 AWL
  • SQL
  • Squirrel
  • Swift
  • Toit
  • TrumpScript
  • Typescript
  • V
  • Vala
  • VHDL
  • Webassembly
  • Wenyan
  • Zig