Run the following in a SAGE environment (or replace is_prime with your own primality testing function and run in a Python interpreter) to find examples:
n = 1
while n < 100:
n = n+1
k = 6*n - 1
if is_prime(k)==1:
r = 1
while r < (3*n - 1):
if 4**r%k == 1:
print(n, k, r)
r = r+1
With $k = 6n-1$, the first few triples $(n, k, r)$ it finds that satisfy $4^r \equiv 1 \pmod{k}$ and the prescribed conditions are:
For example,
$$\eqalign{6n-1 = 17,& r = 4\cr
6n-1 = 41,& r = 10\cr
6n-1 = 89,& r = 11\cr
6n-1 = 113,& r = 14\cr
6n-1 = 137,& r = 34\cr
6n-1 = 233,& r = 29\cr
}$$
Run the following in a SAGE environment (or replace
is_primewith your own primality testing function and run in a Python interpreter) to find examples:With $k = 6n-1$, the first few triples $(n, k, r)$ it finds that satisfy $4^r \equiv 1 \pmod{k}$ and the prescribed conditions are: