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". πŸ’–

  • --twin Twin β€” p+2 is prime
  • --triplet Triplet β€” p+6 and (p+2 or p+4) are prime
  • --quadruplet Quadruplet β€” p+2, p+6, and p+8 are prime
  • --cousin Cousin β€” p+4 is prime
  • --sexy Sexy β€” p+6 is prime
  • --safe Safe β€” (p-1)/2 is also prime
  • --sophie Sophie Germain β€” 2p+1 is also prime
  • --lucas Lucas β€” L_p is prime
  • --fibonacci Fibonacci β€” F_p is prime
  • --mersenne Mersenne β€” M_p = 2^p-1 is prime
  • --lucky Lucky β€” p is a lucky number
  • --palindr Palindromic β€” p is equal to p with its base-10 digits reversed
  • --pillai Pillai β€” n! % p = p-1 and p % n != 1 for some n
  • --good Good β€” p_n^2 > p_{n-i}*p_{n+i} for all i in (1..n-1)
  • --cuban1 Cuban (y+1) β€” p = (x^3 - y^3)/(x-y), x=y+1
  • --cuban2 Cuban (y+2) β€” p = (x^3 - y^3)/(x-y), x=y+2
  • --pnp1 Primorial+1 β€” p#+1 is prime
  • --pnm1 Primorial-1 β€” p#-1 is prime
  • --euclid Euclid β€” pn#+1 is prime
  • --circular Circular β€” all digit rotations of p are prime
  • --panaitopol Panaitopol β€” p = (x^4-y^4)/(x^3+y^3) for some x,y
  • --linnik Linnik β€” p = x^2 + y^2 + 1 for x,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