5

A while ago, I came up with this formula:

$$\sum_{n=2}^{\lfloor\sqrt{x}\rfloor}\left\lfloor\frac{x}{n}-n+1\right\rfloor$$

Which, for the given value of $x$, returns the number of factor pairs that have a product below x (not counting multiples of 1). If you graph it as an equation, you'll notice that the equation doesn't climb at a prime number. This is because, of course, prime numbers don't have any factor pairs except for 1 and itself, which aren't shown.

Which means if I say the above formula is equal to $f(x)$ then I can do this:

$$p(x)=f(x)-f(x-1)$$

And if $p(x)$ returns 0, that means that $x$ is prime.

A few questions I have:

  1. Can I further simplify $p(x)$ and if so, by how much?

  2. Is it possible to convert this equation to something without summation, or another repetitive operator? Is there a proof that it can't be?

This is my first post on StackExcange, so apologies if I messed anything up.

Noah L
  • 151
  • 1
    See this related answer (which is mine, to be fair). In short, there is not much "value" with this type of formulas, which are essentially not different than a computer program. Well, all formulas are, but the real achievement in the specific case at hand would be to find a formula which yields a significantly lower computation-time. How significant? Well, less than exponential in terms of the bit-length of the input number. – barak manos Dec 15 '16 at 14:23
  • @barak manos In that case, is there a way to convert any summation to a more simplified formula? Or, as I said in the original question, any way to prove this can't be simplified? I appreciate your information, but I wasn't trying to prove something, just ask questions about what I had found. – Noah L Dec 15 '16 at 21:45
  • "is there a way to convert any summation to a more simplified formula?" - sometimes it is extremely hard to prove that there is no way (i.e., there does not exist an algorithm) to do something at a certain computation time (NP-complete, for example). There could be a way, but it hasn't been found as of yet. A "prime formula" which does not consists of a "repetition operator" ($\sum$, $\prod$, etc.), is indeed a kind of "holy grail" in number theory. I suppose that any such formula would indeed use an integer function (i.e., floor or ceiling or round), just as you have. – barak manos Dec 16 '16 at 07:02
  • BTW, even a formula which does not make use of $\sum$ or $\prod$, might still be hard to compute. Take Mills' constant for example (though it is not exactly equivalent to your prime-testing function, but still a good example for what I'm about to say). Even if the exact value of $A$ was known, computing $\lfloor{A^{3^n}}\rfloor$ would be "time consuming" (though I guess, still much more efficient than any other known prime generating function). – barak manos Dec 16 '16 at 07:06

1 Answers1

0
  1. yes, for $p(x)$, $f(x)$ can be reduced to $\sum_{n=2}^{\lfloor\sqrt{x}\rfloor}\left\lfloor\frac{x}{n}\right\rfloor$
  2. no, basically what $f(x)$ is doing is performing a standard prime test by dividing x by every number up to $\sqrt{x}$.