First-order logic formula(prime numbers)

1.8k Views Asked by At

How to write into a first-order logic formula:

1) $m$ is prime number, which consists in $[\sqrt{n},n]$

2) $n$ is number of second power of prime number.

$\textbf{My work:}$

Prime number can be written like: $prime(x) = 1<x\, \wedge\, \forall u, v (x = u \cdot v \rightarrow u = 1 \vee v =1)$.

2) I think that in this case it can be written like $n = 1<n\, \wedge\, \forall u, v (n = u\cdot u \cdot v \cdot v \rightarrow u = 1 \vee v =1)$, but Im not sure

1) Here I have no idea, how to do it...

1

There are 1 best solutions below

0
On BEST ANSWER

Hints:

For (1), $m \in [\sqrt{n}, n]$ iff $n \le m^2 \le n^2$.

For (2), it is much simpler to use an existential quantifier to express the property that there exists a prime, $p$, such that $n = p^2$. Your suggestion involves a neat idea but it doesn't quite work, e.g., your predicate holds if $n$ is not a square, because then there are no $u$ and $v$ such that $n = u^2v^2$.