PRIMES.PL(1)
π PRIMES.PL β a user command, and honestly? iconic
okay bestie, gather round, it's time to talk about primes.pl, aka the little Perl script that will pull every single prime number out of the void for you. it lives in section 1 of the manual, it's a user command, and it's lowkey beautiful. π¦
β¨ NAME β¨
primes.pl β Display all primes
π SYNOPSIS π
primes [options] [START] END
π DESCRIPTION π
so here's the vibe: this shows you all the primes sitting between the positive integers START and END, and yes, inclusive on both ends, we are being generous today. π«Ά
START and END have to be integers or simple expressions β not vibes, actual math. but simple expressions is doing a LOT of heavy lifting here, because it means you can throw stuff like 10**500+100 or 2**64-1000 or 2 * nth_prime(560) at it and it just. handles it. slay. π
oh and ALSO β plot twist β if END starts with a '+', it's assumed to add on to START. cute, right? π₯°
and if you only give it one number? it shows you all the primes up to that number, because START defaults to 0. one number in, whole prime list out, main character energy fr fr. β¨
general options πΈ
--helpβ displays this help message. iconic, self-explanatory, we respect it.
filter options π§
these ones take the prime list and filter it down so you only get primes that ALSO meet the extra condition. it's giving "yes and". π
--twinTwin βp+2is prime--tripletTriplet βp+6and (p+2orp+4) are prime--quadrupletQuadruplet βp+2,p+6, andp+8are prime--cousinCousin βp+4is prime--sexySexy βp+6is prime--safeSafe β(p-1)/2is also prime--sophieSophie Germain β2p+1is also prime--lucasLucas βL_pis prime--fibonacciFibonacci βF_pis prime--mersenneMersenne βM_p = 2^p-1is prime--luckyLucky βpis a lucky number--palindrPalindromic βpis equal topwith its base-10 digits reversed--pillaiPillai βn! % p = p-1andp % n != 1for somen--goodGood βp_n^2 > p_{n-i}*p_{n+i}for alliin(1..n-1)--cuban1Cuban (y+1) βp = (x^3 - y^3)/(x-y),x=y+1--cuban2Cuban (y+2) βp = (x^3 - y^3)/(x-y),x=y+2--pnp1Primorial+1 βp#+1is prime--pnm1Primorial-1 βp#-1is prime--euclidEuclid βpn#+1is prime--circularCircular β all digit rotations ofpare prime--panaitopolPanaitopol βp = (x^4-y^4)/(x^3+y^3)for somex,y--linnikLinnik βp = x^2 + y^2 + 1forx,y >= 0--provableβ Ensure all primes are provably prime
π¨ okay important note bestie: options can be combined, e.g. display only safe twin primes. stack them, mix them, go feral.
π and in all cases involving multiples (twin, triplet, etc.), the value returned is p β the least value of the set. so like, the group's leader. the front of the lineup.
π AUTHOR π
Written by Dana Jacobsen. π
and that's the whole page, bestie, you ate it. π
this was primes.pl version 1.3 using Ma... (the version string got a lil cut off in the wild, we don't make the rules π), dated August 2026 β and the page itself is PRIMES.PL(1) in the User Commands section. no cap. periodt. π
β¨
π¦ where this page comes from
- ubuntu stonking: libmath-prime-util-perl 0.74-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms