I am not a mathematician or a math student, but an electrical engineer. I have noticed that an arithmetic sequence modulo a prime number p contains every integer between zero and that prime number if the arithmetic sequence has at least p elements and the arithmetic sequence has a common difference less than p.
A couple questions:
Does this have a name?
What reference would help me understand this, or can you help me understand this?
An example in Python is shown below.
import numpy as np
https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n?page=1&tab=scoredesc#tab-top
def primes(n):
""" Returns a list of primes < n """
sieve = [True] * n
for i in range(3,int(n*0.5)+1,2):
if sieve[i]:
sieve[ii::2i]=[False]((n-ii-1)//(2i)+1)
return [2] + [i for i in range(3,n,2) if sieve[i]]
Common differences for arithmetic sequences
d_list = np.arange(2,20)
Prime numbers
p_list = primes(50)
for p in p_list:
# Common difference must be less than prime number
sub_d = d_list[d_list < p]
for d in sub_d:
all_ints = set(np.arange(p))
seq = np.arange(0, d*p, d)
mod_set = set(seq % p)
if not mod_set == all_ints:
print(f'Broken at {d},{p}!')
Thank you