7
$\begingroup$

Here's the function I created (I have a very long proof too): $$(-1)^{\dfrac{4\Gamma( (x-1)(1-(\lceil x\rceil-\lfloor x\rfloor)+1) )+4}{(x-1)(1-(\lceil x\rceil-\lfloor x\rfloor))+1}}-1,\quad x>1$$ Is there any use for this? As far as I know it's the first of its kind. Wolfram Alpha link.

$\endgroup$
5
  • 1
    $\begingroup$ @YuriyS He has already proven it is sufficient for every prime. $\endgroup$
    – Mr Pie
    Commented Jan 29, 2018 at 10:16
  • $\begingroup$ Also, your function $f(x)$, although very nice, is similar to the recurrence relation, $$a_n = \{a_{n-1} + \gcd(n, a_{n - 1}) : a_1 = 7\}$$ for which $a_n - a_{n-1} = \gcd(n, a_{n-1})$ equates to $1$ if not prime. $\endgroup$
    – Mr Pie
    Commented Jan 29, 2018 at 10:18
  • 7
    $\begingroup$ I guess you should state it as: $$(-1)^{k(x)}-1$$ Where: $$k(x)=\dfrac{4\Gamma( (x-1)(1-(\lceil x\rceil-\lfloor x\rfloor)+1) )+4}{(x-1)(1-(\lceil x\rceil-\lfloor x\rfloor))+1}$$ Or: $$(-1)^{\tiny \dfrac{4\Gamma( (x-1)(1-(\lceil x\rceil-\lfloor x\rfloor)+1) )+4}{(x-1)(1-(\lceil x\rceil-\lfloor x\rfloor))+1}} -1 $$ It gets a little bit more readable. I for one spent a lot of time trying to understand why there were floating a $"(-1)"$ and a floating $-1$. $\endgroup$
    – Red Banana
    Commented Jan 29, 2018 at 15:29
  • 2
    $\begingroup$ It might be worth noting that slightly less trivially, one can define the function $\prod_p (1-\frac zp)e^{z/p}$, where the product is over all primes; by the Weierstrass theorem this function is entire and has zeros at the primes and nowhere else. Alternately, if one wants to include $-2, -3, -5, \ldots$ as primes, then the product $\prod_p \left(1-(\frac zp)^2\right)$ (here the product is over the positive primes, but by construction the function will have zeros at their negatives as well) will also do the trick. $\endgroup$ Commented Jan 30, 2018 at 0:10
  • 2
    $\begingroup$ This seems very cool, and I think the existing answers don't do it enough justice. $\endgroup$ Commented Jan 30, 2018 at 7:23

2 Answers 2

47
$\begingroup$

Your function simplifies to $$(-1)^{4((x-1)!+1)/x}-1$$ and is just a restatement of Wilson's theorem: $(n-1)!\equiv-1\bmod n$ iff $n$ is prime.

If $x$ is prime, $((x-1)!+1)/x=k$ is an integer and $(-1)^{4k}-1$ evaluates to zero. If $x$ is composite and $\ge6$, $k=n+\frac1x$ where $n$ is an integer, so $(-1)^{4k}-1$ does not evaluate to zero. The function evaluated at $x=4$ gives $k=7/4$, which makes $(-1)^{4k}-1=-2\ne0$.

$\endgroup$
8
  • $\begingroup$ Hello, could you please clarify the step that says k = n + 1/x if x is composite gte 6? $\endgroup$
    – Pedro A
    Commented Jan 29, 2018 at 13:53
  • 3
    $\begingroup$ @Hamsterrific Wilson's theorem also says that if $n$ is composite and greater than 6, $(n-1)!\equiv0\bmod n$. Then $k=((x-1)!+1)/x=(x-1)!/x+1/x$, and $(x-1)!/x$ is an integer by the previous argument. $\endgroup$ Commented Jan 29, 2018 at 13:55
  • $\begingroup$ Ah, I didn't know that Wilson's Theorem had this "second part". Thanks $\endgroup$
    – Pedro A
    Commented Jan 29, 2018 at 14:04
  • $\begingroup$ @ParclyTaxel thanks! It seems the function only works if input is guaranteed to be an integer. Otherwise, this will have roots between the integers, so it's not a complete simplification of mine because of the removal of the floor and ceiling, but it still explains what's going on to show that this isn't really 'new'. Thanks! $\endgroup$ Commented Jan 29, 2018 at 16:48
  • 3
    $\begingroup$ @goblin We treat $-1=e^{i\pi}$; all the properties of exponentiating it with any real power follow. $\endgroup$ Commented Jan 30, 2018 at 7:30
20
$\begingroup$

As far as I know it's the first of its kind.

It is certainly not. The function

$$f(x)=\begin{cases}0 & \text{ if } x \text{ is prime}\\ 1& \text{otherwise}\end{cases}$$

is also a function for which $f(x)=0$ if and only if $x$ is prime.

Also, replacing $4$ with $2$ seems to maintain the property.

$\endgroup$
2
  • 34
    $\begingroup$ That is formally correct, but I wonder if it is the answer which Albert is looking for, as his expression is more or less "elementary". – (Ask a mathematician “Can you tell me what time it is?” – Answer: “Yes.”) $\endgroup$
    – Martin R
    Commented Jan 29, 2018 at 10:18
  • 3
    $\begingroup$ @MartinR That was a very good comparison haha $\endgroup$
    – Mr Pie
    Commented Jan 29, 2018 at 10:19

Not the answer you're looking for? Browse other questions tagged .