Group Abstract Group Abstract

Message Boards Message Boards

0
|
473 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Program which finds prime numbers via using an approximation formula

Posted 1 month ago
5 Replies

Also, Dear David it would be great if you could submit brief comment and your mathematica program to OEIS A223881. Cheers, Alex

Thanks David!

It would be great if you would post it as an answer at

https://math.stackexchange.com/questions/5030561

Thanks for your reply Alex

This is not a rigorous proof, but since $$\frac{m!}{p_{m-1} + 1}$$ will only be a fraction when $p_{m-1} +1$ has a prime factor that cannot be cancelled by $m!$, and $m!$ has enough prime factors to cancel any prime factors of $p_{m-1}+1$ less than $m$, the values of your OEIS sequence can be found by identifying where the largest prime factor of $p_{m-1}+1$ is greater than $m$. This will always be prime since this largest factor can only divide $p_{m-1}+1$ once since $p_{m-1}+1 < m^2$

Therefore the sequence can be found by using the LargestPrimeFactor resource function, and identifiying where Prime[m - 1] + 1 has a largest prime factor greater than m (there is one exception when m=3):

ClearAll["`*"]
lpf = ResourceFunction["LargestPrimeFactor"]

sequenceIndex = 1;

dat = Table[
   denom = Prime[m - 1] + 1;
   largest = lpf[denom];
   If[largest > m || m == 3,
    {denom/largest, sequenceIndex++, largest}
    ,
    Nothing]
   , {m, 2, 6000}
   ];

Note that I keep track also of denom/largest, the value of $p_{m-1}+1$ divided by its largest factor. If we gather the sequence terms by denom/largest, we see we recover the distinct families:

gathered = #[[All, 2 ;; All]] & /@ GatherBy[dat, First];
ListLinePlot[gathered]

enter image description here

These families correspond to when $p_{m-1}+1 = 2L , 4L, 6L.... $ where $L$ is the largest prime factor of $p_{m-1}+1$.

POSTED BY: David Trimas
Posted 23 days ago
POSTED BY: Updating Name

I am attaching 4 text files each containing prime numbers, belonging to one of the 4 groups. Those four groups (files) were generated by Kristian Pontoppidan Larsen using unknown to me method. The task of the program which I am trying to write is to recreate generation of those 4 groups (files).

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard