A277776 Triangle T(n,k) in which the n-th row contains the increasing list of nontrivial square roots of unity mod n; n>=1.
3, 5, 5, 7, 4, 11, 7, 9, 9, 11, 8, 13, 5, 7, 11, 13, 17, 19, 13, 15, 11, 19, 15, 17, 10, 23, 6, 29, 17, 19, 14, 25, 9, 11, 19, 21, 29, 31, 13, 29, 21, 23, 19, 26, 7, 17, 23, 25, 31, 41, 16, 35, 25, 27, 21, 34, 13, 15, 27, 29, 41, 43, 20, 37, 11, 19, 29, 31, 41
Offset: 1
Examples
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;
Links
- Alois P. Heinz, Rows n = 1..5300, flattened
Crossrefs
Programs
-
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 *)
-
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
A277776_list = list(islice(A277776_gen(),30)) # Chai Wah Wu, Oct 26 2022
Comments