# How do I find how many numbers are prime(taking absolute value of negatives) in a list? When i use count it returns zero

    f =  9x^2 - 78x-10000
list1 = PrimeQ[Abs[f /. x -> {Range[1, 20]}]]
Count[list1,True]


This is my code. Im trying to find how many prime numbers there are between the range 1-20. If a number is negative i have to take the absolute value of it.

I need to know how many numbers are prime. I tried using count(i want to see how many times true shows up) but it keeps returning 0 thank you

• Your code can be simplify. f = 9 x^2 - 78 x - 10000; list1 = PrimeQ[Abs[f /. x -> Range[1, 20]]]; Count[list1, True] Sep 28, 2020 at 14:26
• how can i add simplify? thank you
– Aran
Sep 28, 2020 at 14:33
• thank you i just tried it it works!
– Aran
Sep 28, 2020 at 14:43
• Abs is not need. Sep 28, 2020 at 14:43
• My prof said to take the absolute value of the negative numbers, what else can i use besides abs, thank you
– Aran
Sep 28, 2020 at 14:45

f = 9 x^2 - 78 x - 10000

PrimeQ automatically treats negative primes as prime, which is why you don't need Abs.