Jump to content

Erdös-Selfridge categorization of primes: Difference between revisions

m
m (→‎{{header|J}}: some docs for people who are not comfortable reading J)
m (→‎{{header|J}}: grammar)
Line 360:
Explanation: this is a recursive function defined only on primes. We memoize it for good performance.
 
To find the prime category of a prime, we find the prime factorization of the next larger integer, and find the category of each of those factors other than 2 or 3. The prime's category 1is one greater than the maximum of these factor categories (with an explicit 0 for the maximum when there are nofactors suchgreater factorsthan 3)
 
First 200 primes -- category is in left box, primes are in right box:
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.