prime -package:arithmoi

Not on Stackage, so not searched. prime number tools
Identifier ends in Integer many primes.
Deprecated: This module is a perpetual draft and will therefore be removed from xmonad-contrib in the near future.
A Prime is a function that transforms an XConfig. It's not a monad, but we turn on RebindableSyntax so we can abuse the pretty do notation.
Module for finding the greatest prime number that is less than or equal to a given number
Like primElemRepSizeB but assumes pointers/words are 8 words wide. This can be useful to compute the size of a rep as if we were compiling for a 64bit platform.
The prime prefix; primePrefix mempty == mempty for monoids.
The prime suffix; primeSuffix mempty == mempty for monoids.
Efficient, purely functional generation of prime numbers This Haskell library provides an efficient lazy wheel sieve for prime generation inspired by Lazy wheel sieves and spirals of primes by Colin Runciman and The Genuine Sieve of Eratosthenes by Melissa O'Neil.
Yields the sorted list of prime factors of the given positive number. This function uses trial division and is impractical for numbers with very large prime factors.
This global constant is an infinite list of prime numbers. It is generated by a lazy wheel sieve and shared across the whole program run. If you are concerned about the memory requirements of sharing many primes you can call the function wheelSieve directly.
Get the name of the equality type.
primEraseEquality : {a : Level} {A : Set a} {x y : A} -> x ≡ y -> x ≡ y
The prime numbers. Implemented with the algorithm in:
primeLayout takes a positive integer p (the idea is for it to be prime, though it doesn't really matter) and a diagram, and lays out p rotated copies of the diagram in a circular pattern. There is a special case for p = 2: if the given diagram is taller than it is wide, then the two copies will be placed beside each other; if wider then tall, they will be placed one above the other. The regular p-gon connecting the centers of the laid-out diagrams is also filled in with vertical bars of color representing the number p. In particular, there is one color for each decimal digit (the provided list should have length 10 and represents the digits 0-9), and the colors, read left to right, give the decimal expansion of p.
import Diagrams.TwoD.Factorization
plExample
= pad 1.1 . centerXY
. hsep 0.5
. map (sized (mkWidth 1))
$ [ primeLayout defaultColors 5 (circle 1 # fc black)
, primeLayout defaultColors 103 (square 1 # fc green # lw none)
, primeLayout (repeat white) 13 (circle 1 # lc orange)
]
Cycles through a list of variable names priming them at each iteration.
primeCycle ["x","y","z"]
  • "x","y","z","x'","y'","z'","x''","y''","z''","x'''",...
This data is auto-generated by GenPrimes.hs. The vector contains tuples (p, m, s) such that p is prime and (assuming 64-bit architecture) for every n >= 0 it holds that n `quot` p = (n * m) `shiftR` (64 + s), enabling faster computation of remainders.