# Tag Info

### Coprimes up to N

Python 2, 61 47 bytes lambda n:[k/n for k in range(n*n)if k/n*k%n==1] Try it online! Background Consider the ring $(Z_n, +_n, \cdot_n)$. While this ring is ...
• 210k

### Is this number a prime?

Hexagony, 28 bytes Since Etoplay absolutely trounced me on this question, I felt that I had to outgolf his only other answer. ...
• 11.6k
Accepted

• 15.8k

### Compute the Carmichael function

Python, 76 73 67 bytes f=lambda n,k=1:1-any(a**-~k*~-a**k%n for a in range(n))or-~f(n,k+1) Try it online! A further byte could be saved by returning True instead ...
• 210k

### Recognize most smaller primes with a regex

90 79 72 67 65 64 bytes ^(?!([258][0369]*[147]|[1475][258]|[147]{3}|[0369])+$)\d+[1379]$ Matches 2–3-digit numbers not divisible by 2, 3, or 5, with an added bit (...
• 10.5k

### Approximate Brun's Constant

Python 3, 78 77 75 70 68 62 bytes f=lambda n,k=3,m=1,j=0:k<n and-m%k*j*2/k+f(n,k+2,m*k**4,m%k/k) Thanks to @xnor for golfing off 2 4 bytes and paving the way ...
• 210k

### Is it a weak prime?

Jelly, 7 bytes Æn+Æp>Ḥ Try it online! Explanation ...
• 17.9k

### Is it a Mersenne Prime?

05AB1E, 5 bytes A positive number in the form 2n - 1 in binary only consists of 1's. Code: b`¹pP Explanation: ...
• 44.4k
Accepted

### Output the PPCG Prime

Jelly, 55 54 52 47 46 bytes “=÷¡v⁺ʋiṂYR¤"bİɲ}Ñ1Ṇ⁴ẠV⁹yȥGẇ’“¿mŻ“p’Dx39jBo88V There are more convoluted approaches in the revision history, but this simple one ...
• 210k

### Coprimes up to N

Jelly, 4 bytes gRỊT Try it online! How it works ...
• 210k

### The program that will find the next prime number

Mathematica, 9 bytes NextPrime
• 15.8k

### ​Cuban​ ​Primes

JavaScript (V8), 54 bytes A full program that prints cuban primes forever. for(x=0;;){for(k=N=~(3/4*++x*x);N%++k;);~k||print(-N)} Try it online! NB: Unless you ...
• 193k

### Primes with a twist

Jelly, 13 bytes “Ŀo‘’FQỌµḟ;¹V Try it online! or run the first ten programs. Background Jelly has several different types of string literals; all of them start ...
• 210k

### Primes with a twist

GS2 (commit 67fea47), 6 3 bytes dnR How it works Like most commands, GS2‘s d is overloaded. Initially, there's an empty list ...
• 210k

### Is this number a prime?

JavaScript, 39 36 bytes Saved 3 bytes thanks to ETHproductions: for(i=n=prompt();n%--i;);alert(1==i) Displays true for a prime, false otherwise. The for loop ...
• 1,977

### Is it a super-prime?

Jelly, 5 bytes ÆRÆNċ Try it online! How it works ...
• 210k
Accepted

### Do I have a prime twin?

Brachylog, 9 8 bytes ṗ∧4√;?+ṗ Try it online! Explanation ...
• 38.9k

### Find the Smoothest Number

Regex (Perl / PCRE), 66 65 (64🐌) bytes Inspired by seeing that both Martin Ender and jaytea, two regex geniuses, wrote regex solutions to this code golf, I wrote my own from scratch. The famous prime-...
• 11.6k

### Is this number a prime?

Stack Cats, 62 + 4 = 66 bytes *(>:^]*(*>{<-!<:^>[:((-<)<(<!-)>>-_)_<<]>:]<]]}*<)]*(:)*=<*)>] Needs to be run ...
• 197k

### Is this number a prime?

Brain-Flak, 112 108 bytes ...
• 210k

### Prime Wednesdays

Python 2, 95 93 68 67 bytes lambda y:0x10ea2c8dbb06c5619/5**((y+((y-22)/99-y/2002)*16)%28)%5+16 Thanks to @Josay for golfing off 1 byte! Test it on Ideone.
• 210k
Accepted

### Is it a Mersenne Prime?

Jelly, 5 bytes &‘<ÆP Try it online! How it works ...
• 210k
Accepted

### Is it a semiprime?

Brachylog, 2 bytes Basically a port from Fatalize's answer to the Sphenic number challenge. ḋĊ Try it online! How? ...
• 108k

Only top scored, non community-wiki answers of a minimum length are eligible