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.
%I A228179 #41 Oct 26 2022 20:52:33 %S A228179 1,1,2,1,3,1,4,1,5,1,6,1,3,5,7,1,8,1,9,1,10,1,5,7,11,1,12,1,13,1,4,11, %T A228179 14,1,7,9,15,1,16,1,17,1,18,1,9,11,19,1,8,13,20,1,21,1,22,1,5,7,11,13, %U A228179 17,19,23,1,24,1,25,1,26,1,13,15,27,1,28,1,11 %N A228179 Irregular table where the n-th row consists of the square roots of 1 in Z_n. %C A228179 Each 1 starts a new row. %C A228179 This is a subsequence of A020652. %C A228179 Row n has A060594(n) entries. %C A228179 Each row forms a subgroup of the multiplicative group of units of Z_n. %H A228179 Alois P. Heinz, <a href="/A228179/b228179.txt">Rows n = 2..2000 of irregular triangle, flattened</a> %e A228179 The table starts out as follows: %e A228179 1 %e A228179 1 2 %e A228179 1 3 %e A228179 1 4 %e A228179 1 5 %e A228179 1 6 %e A228179 1 3 5 7 %e A228179 1 8 %e A228179 1 9 %e A228179 1 10 %e A228179 1 5 7 11 %e A228179 ... %p A228179 T:= n-> seq(`if`(k&^2 mod n=1, k, NULL), k=1..n-1): %p A228179 seq(T(n), n=2..50); # _Alois P. Heinz_, Aug 20 2013 %t A228179 Flatten[Table[Position[Mod[Range[n]^2, n], 1], {n, 2, 50}]] (* _T. D. Noe_, Aug 20 2013 *) %o A228179 (Sage) [[i for i in [1..k-1] if (i*i).mod(k)==1] for k in [2..n]] #changing n gives you the table up to the n-th row. %o A228179 (Python) %o A228179 from itertools import chain, count, islice %o A228179 from sympy.ntheory import sqrt_mod_iter %o A228179 def A228179_gen(): # generator of terms %o A228179 return chain.from_iterable((sorted(sqrt_mod_iter(1,n)) for n in count(2))) %o A228179 A228179_list = list(islice(A228179_gen(),30)) # _Chai Wah Wu_, Oct 26 2022 %Y A228179 Cf. A060594, A038566, A020652, A082568. %Y A228179 Cf. A070667 (second column), A358016 (second-last column). %Y A228179 Cf. A277776 (nontrivial square roots of 1). %K A228179 nonn,easy,tabf %O A228179 2,3 %A A228179 _Tom Edgar_, Aug 20 2013