Trick to find if number is composite or prime

1.1k Views Asked by At

I was doing some maths and required a function which mimics the following function:

$$ f(k,c) = \mid \sin(k/2) \sin(k/3) ... \sin(k/c) \mid $$

So that I can evaluate (say $ f(k,3.5) $) or is there any other method by which I can take derivatives with respect to c (without knowing the proper f function)?

I think it would be unfair of me not to tell you the motivation:

Let's say we have a composite number: $ z = xy $

Where $ x<z^{1/2}<y<z $

Then if we evaluate $ f(z \pi ,x)=0 $ as $\sin(z\pi/x)=\sin(y\pi) =0$

So it is a matter of finding the zeros of $f$ which my instincts and a bit of graphing the function $f$ (with pen and paper) tell me will be at:

$$\partial f/\partial c=0$$

If the first zero lies on the number $z$ itself the number is prime else if $f$ becomes $0$ before that it is a composite.

P.S: If there is any clarification required feel free to comment

1

There are 1 best solutions below

2
On

You can't take derivatives of this function with respect to $c$, because it's defined only for integer values of $c$.