OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
a(3) = 4 because A033949(3) = 15 and 4^2 = 16 == 1 mod 15 is the first integer to do so.
PROG
(PARI) for (n=3, 100, for (j=2, n-2, if (j^2%n==1, print1(j", "); break)))
(Python)
from itertools import chain, count, islice
from sympy.ntheory import sqrt_mod_iter
def A082568_gen(): # generator of terms
return chain.from_iterable((sorted(filter(lambda m:1<m<n-1, sqrt_mod_iter(1, n)))[:1] for n in count(2)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, May 06 2003
EXTENSIONS
Offset corrected, name clarified and more terms from Alois P. Heinz, Oct 30 2016
STATUS
approved