A277777 Largest nontrivial square root of unity modulo the n-th positive integer that does not have a primitive root (A033949).
5, 7, 11, 9, 11, 13, 19, 15, 19, 17, 23, 29, 19, 25, 31, 29, 23, 26, 41, 35, 27, 34, 43, 37, 49, 55, 33, 51, 43, 35, 47, 41, 55, 49, 39, 43, 53, 71, 71, 69, 59, 67, 71, 64, 47, 61, 56, 79, 89, 51, 67, 79, 76, 55, 89, 73, 97, 77, 91, 59, 64, 69, 109, 83, 63, 71
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
- Wikipedia, Root of unity modulo n
Programs
-
Python
from gmpy2 import * def f(n): for k in range(n - 2, 0, -1): if pow(k, 2, n) == 1: return k def A277777(L): return [j for j in [f(k) for k in range(3, L + 1)] if j > 1] # DarĂo Clavijo, Oct 15 2022
-
Python
from itertools import count, islice from sympy.ntheory import sqrt_mod_iter def A277777_gen(): # generator of terms for n in count(3): if (m:=max(filter(lambda k:k
1: yield m A277777_list = list(islice(A277777_gen(),30)) # Chai Wah Wu, Oct 26 2022