11

Found a clever little algorithm for computing the product of all primes between n-m without recomputing them.

We'll start with the product of all primes up to some n.

so [2, 2*3, 2*3*5, 2*3*5*,7..] etc

prods = []
i = 0
total = 1
while i < 100:
....total = total*primes[i]
....prods.append(total)
....i = i + 1

Terrible variable names, can't be arsed at the moment.
The result is a list with the values

2, 6, 30, 210, 2310, 30030, etc.

Now assume you have two factors,with indexes i, and j, where j>i

You can calculate the gap between the two corresponding primes easily.
A gap is defined at the product of all primes that fall between the prime indexes i and j.

To calculate the gap between any two primes, merely look up their index, and then do..
prods[j-1]/prods[i]

That is the product of all primes between the J'th prime and the I'th prime

To get the product of all primes *under* i, you can simply look it up like so:

prods[i-1]

Incidentally, finding a number n that is equivalent to (prods[j+i]/prods[j-i]) for any *possible* value of j and i (regardless of whether you precomputed n from the list generator for prods, or simply iterated n=n+1 fashion), is equivalent to finding an algorithm for generating all prime numbers under n.

Hypothetically you could pick a number N out of a hat, thats a thousand digits long, and it happens to be the product of all primes underneath it.

You could then start generating primes by doing
i = 3
while i < N:
....if (N/k)%1 == 0:
........factors.append(N/k)
....i=i+1

The only caveat is that there should be more false solutions as real ones. In otherwords theres no telling if you found a solution N corresponding to some value of (prods[j+i]/prods[j-i]) without testing the primality of *all* values of k under N.

Comments
  • 5
  • 4
    You're the missing actor from the big bang theory series. Wtf
  • 4
    That's my boy!
  • 4
    This seems to prove that products contain the factors that produce them, and that products can be factors of other products, and that primes can be factors, but not products of anything other than 1 and itself. Am I missing anything?
  • 4
    @tedge you too, are capable, like myself, of stating the obvious!

    We're both gonna go places!

    Probably to repeat 9th grade, but hey, that still counts as a place!
  • 3
    @scor at this stage chatgpt could probably just write my posts.

    Dear god, I've become predictable.
  • 4
    :) it got me a little interested, there’s a million dollar bounty on predicting primes. Maybe you’ve already looked at Eulers product formula and the Riemann zeta function?
  • 3
    @tedge whether or not theres a predictable pattern to primes could likely be proven by proving primes are a subset of the quasi-lucas carmichael (QLC) numbers (covered in another post). Probably whatever functions generate both, simply overlap up to a very large value of N.

    The riemann zeta function gives you a sort of 'mathematical landscape' and tells you the 'height of the landscape at sea level' for some input. It's interesting because my gut tells me it could probably be approached with something similar to marching cubes, only with higher dimensional geometric primitives (sort of like quantized elliptic curves). Whatever algorithm that allowed you to retrieve the surface from the quantization of the input might be functionally equivalent to a proof of riemann zeta.

    But I'm not at all familiar with the math and this is just a cursory reading on my part.

    I'm probably wildly misunderstanding more than a few things to make these assumptions.
  • 2
    @Wisecrack we used to think the path of electrons in an atom were random until we discovered quantum entanglement, suggesting that there could be a pattern.
  • 0
    Hell yaw ! 🙌
  • 1
    @tedge How so? Doesn't Heisenberg's Uncertainty Principle basically rule out any deterministic (i.e. non-random) theorem about subatomic particle kinetics?

    Disclaimer: I may be very wrong, because I am very non-physicistic.
  • 0
    Subset* wasnt entirely correct.

    Subset of a function that generates both QLC numbers and primes.
    The function exists I just dont have the background in math to write proofs.
  • 0
    @retoor the one that can't keep up with the others, lol.
Add Comment