This has to be a formula with one free variable v1.v1 is a prime of the form p^2+p+1, where p is prime

Here, on the other hand, the only free variable is p. Also, in p*P, it confuses p, which is a number, with P, which is apparently a unary predicate saying that its argument is prime.(There exists v1)(P(p)-->(v1=p*P+P+0') )

You need to say that (1) there exists some prime p, (2) v1 = p * p + p + 0' and (3) v1 is prime.