Skip to content

Instantly share code, notes, and snippets.

is_ONE = (v)=>{
let ret = 0;
for(let i=1;i<=v;i++){
// find divisor i
if(!(v%i)){
let mu = 1;
// find prime factor of i
for(let j=2;j <= i;j++){
if(i%j)continue;
// check if j is prime