cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A277776 #30 Oct 26 2022 16:11:14
%S A277776 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,
%T A277776 29,17,19,14,25,9,11,19,21,29,31,13,29,21,23,19,26,7,17,23,25,31,41,
%U A277776 16,35,25,27,21,34,13,15,27,29,41,43,20,37,11,19,29,31,41
%N 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.
%C A277776 Rows with indices n in A033948 (or with A046144(n)=0) are empty.  Indices of nonempty rows are given by A033949.
%C A277776 This is A228179 without the trivial square roots {1, n-1}.
%C A277776 The number of terms in each nonempty row n is even: A060594(n)-2.
%H A277776 Alois P. Heinz, <a href="/A277776/b277776.txt">Rows n = 1..5300, flattened</a>
%e A277776 Row n=8 contains 3 and 5 because 3*3 = 9 == 1 mod 8 and 5*5 = 25 == 1 mod 8.
%e A277776 Triangle T(n,k) begins:
%e A277776 08 :   3,  5;
%e A277776 12 :   5,  7;
%e A277776 15 :   4, 11;
%e A277776 16 :   7,  9;
%e A277776 20 :   9, 11;
%e A277776 21 :   8, 13;
%e A277776 24 :   5,  7, 11, 13, 17, 19;
%e A277776 28 :  13, 15;
%e A277776 30 :  11, 19;
%p A277776 T:= n-> seq(`if`(i*i mod n=1, i, [][]), i=2..n-2):
%p A277776 seq(T(n), n=1..100);
%p A277776 # second Maple program:
%p A277776 T:= n-> ({numtheory[rootsunity](2, n)} minus {1, n-1})[]:
%p A277776 seq(T(n), n=1..100);
%t A277776 T[n_] := Table[If[Mod[i^2, n] == 1, i, Nothing], {i, 2, n-2}];
%t A277776 Select[Array[T, 100], # != {}&] // Flatten (* _Jean-François Alcover_, Jun 18 2018, from first Maple program *)
%o A277776 (Python)
%o A277776 from itertools import chain, count, islice
%o A277776 from sympy.ntheory import sqrt_mod_iter
%o A277776 def A277776_gen(): # generator of terms
%o A277776     return chain.from_iterable((sorted(filter(lambda m:1<m<n-1,sqrt_mod_iter(1,n))) for n in count(2)))
%o A277776 A277776_list = list(islice(A277776_gen(),30)) # _Chai Wah Wu_, Oct 26 2022
%Y A277776 Columns k=1-2 give: A082568, A357099.
%Y A277776 Last elements of nonempty rows give A277777.
%Y A277776 Cf. A033948, A033949, A046144, A060594, A228179.
%K A277776 nonn,look,tabf
%O A277776 1,1
%A A277776 _Alois P. Heinz_, Oct 30 2016