OFFSET
1,1
COMMENTS
LINKS
Alois P. Heinz, Rows n = 1..5300, flattened
EXAMPLE
Row n=8 contains 3 and 5 because 3*3 = 9 == 1 mod 8 and 5*5 = 25 == 1 mod 8.
Triangle T(n,k) begins:
08 : 3, 5;
12 : 5, 7;
15 : 4, 11;
16 : 7, 9;
20 : 9, 11;
21 : 8, 13;
24 : 5, 7, 11, 13, 17, 19;
28 : 13, 15;
30 : 11, 19;
MAPLE
T:= n-> seq(`if`(i*i mod n=1, i, [][]), i=2..n-2):
seq(T(n), n=1..100);
# second Maple program:
T:= n-> ({numtheory[rootsunity](2, n)} minus {1, n-1})[]:
seq(T(n), n=1..100);
MATHEMATICA
T[n_] := Table[If[Mod[i^2, n] == 1, i, Nothing], {i, 2, n-2}];
Select[Array[T, 100], # != {}&] // Flatten (* Jean-François Alcover, Jun 18 2018, from first Maple program *)
PROG
(Python)
from itertools import chain, count, islice
from sympy.ntheory import sqrt_mod_iter
def A277776_gen(): # generator of terms
return chain.from_iterable((sorted(filter(lambda m:1<m<n-1, sqrt_mod_iter(1, n))) for n in count(2)))
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Oct 30 2016
STATUS
approved