# Online source for counting primes in residue classes

There are many websites and online resources if one wants to know the number of prime numbers up to some $N$, there are online prime number calculators and many tables on various sites. Could anyone possibly point me to a website where I can do this for primes in residue classes?

I want to give an online resource for students in my class to be able to find the number of primes less than $N$ that are $a$ modulo $q$, kinda thing but I haven't been able to find one. I would greatly appreciate any information. Thank you very much!

I did not find it as well, so just did it using Python and put it online, please verify that it makes what you want with some simple tests. Initially seems to do what you needed: here is the link (to repl.it, is a very well known safe place to put online code for simple tests), and here is the Python code just in case you want to give it to your class, use it freely:

def isPrime(num):
if num <= 1:
return False
for factor in range(2, num):
if num % factor == 0:
return False
return True

N = 100
a = 7
q = 15

total = 0
print("List of primes p in [1,"+str(N)+"] such that p mod "+str(q)+" equiv to "+str(a))
for n in range(1,N):
if isPrime(n):
if a==(n%q):
total = total + 1
print(n)

print("Total: " +str(total))


In the link, just modify in the left side the values of $N, a$ and $q$ and then click the run button, the results will appear in the right side. I think it should work normally in very basic navigators.

Please let me know if it does not work.

(*) I forgot to include the total in the initial version, now is included.

• This is so helpful! Thank you very very much!!! – Johnny T. Aug 17 '16 at 2:02
• @JohnnyT. my pleasure! It is very easy to modify I think, so you can make your own account there and make changes to it. Good luck! – iadvd Aug 17 '16 at 2:03