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.

Showing 1-4 of 4 results.

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.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Oct 30 2016

Keywords

Comments

Rows with indices n in A033948 (or with A046144(n)=0) are empty. Indices of nonempty rows are given by A033949.
This is A228179 without the trivial square roots {1, n-1}.
The number of terms in each nonempty row n is even: A060594(n)-2.

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;
		

Crossrefs

Columns k=1-2 give: A082568, A357099.
Last elements of nonempty rows give A277777.

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:1A277776_list = list(islice(A277776_gen(),30)) # Chai Wah Wu, Oct 26 2022

A228179 Irregular table where the n-th row consists of the square roots of 1 in Z_n.

Original entry on oeis.org

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, 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, 17, 19, 23, 1, 24, 1, 25, 1, 26, 1, 13, 15, 27, 1, 28, 1, 11
Offset: 2

Views

Author

Tom Edgar, Aug 20 2013

Keywords

Comments

Each 1 starts a new row.
This is a subsequence of A020652.
Row n has A060594(n) entries.
Each row forms a subgroup of the multiplicative group of units of Z_n.

Examples

			The table starts out as follows:
  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
  ...
		

Crossrefs

Cf. A070667 (second column), A358016 (second-last column).
Cf. A277776 (nontrivial square roots of 1).

Programs

  • Maple
    T:= n-> seq(`if`(k&^2 mod n=1, k, NULL), k=1..n-1):
    seq(T(n), n=2..50);  # Alois P. Heinz, Aug 20 2013
  • Mathematica
    Flatten[Table[Position[Mod[Range[n]^2, n], 1], {n, 2, 50}]] (* T. D. Noe, Aug 20 2013 *)
  • Python
    from itertools import chain, count, islice
    from sympy.ntheory import sqrt_mod_iter
    def A228179_gen(): # generator of terms
        return chain.from_iterable((sorted(sqrt_mod_iter(1,n)) for n in count(2)))
    A228179_list = list(islice(A228179_gen(),30)) # Chai Wah Wu, Oct 26 2022
  • 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.
    

A277777 Largest nontrivial square root of unity modulo the n-th positive integer that does not have a primitive root (A033949).

Original entry on oeis.org

5, 7, 11, 9, 11, 13, 19, 15, 19, 17, 23, 29, 19, 25, 31, 29, 23, 26, 41, 35, 27, 34, 43, 37, 49, 55, 33, 51, 43, 35, 47, 41, 55, 49, 39, 43, 53, 71, 71, 69, 59, 67, 71, 64, 47, 61, 56, 79, 89, 51, 67, 79, 76, 55, 89, 73, 97, 77, 91, 59, 64, 69, 109, 83, 63, 71
Offset: 1

Views

Author

Alois P. Heinz, Oct 30 2016

Keywords

Crossrefs

Last elements of nonempty rows of A277776.

Programs

  • Python
    from gmpy2 import *
    def f(n):
      for k in range(n - 2, 0, -1):
        if pow(k, 2, n) == 1:
          return k
    def A277777(L):
      return [j for j in [f(k) for k in range(3, L + 1)] if j > 1] # Darío Clavijo, Oct 15 2022
    
  • Python
    from itertools import count, islice
    from sympy.ntheory import sqrt_mod_iter
    def A277777_gen(): # generator of terms
        for n in count(3):
            if (m:=max(filter(lambda k:k 1:
                yield m
    A277777_list = list(islice(A277777_gen(),30)) # Chai Wah Wu, Oct 26 2022

Formula

a(n) = A033949(n) - A082568(n).

A357099 Second nontrivial square root of unity mod A033949(n), i.e., second smallest x > 1 such that x^2 == 1 mod the n-th positive integer that does not have a primitive root.

Original entry on oeis.org

5, 7, 11, 9, 11, 13, 7, 15, 19, 17, 23, 29, 19, 25, 11, 29, 23, 26, 17, 35, 27, 34, 15, 37, 19, 55, 33, 51, 43, 35, 47, 41, 19, 49, 39, 43, 53, 31, 29, 69, 59, 23, 71, 64, 47, 61, 56, 31, 89, 51, 67, 27, 34, 55, 89, 73, 41, 77, 91, 59, 64, 69, 19, 83, 63, 71
Offset: 1

Views

Author

Alois P. Heinz, Oct 25 2022

Keywords

Crossrefs

Column k=2 of A277776.

Programs

  • Python
    from itertools import count, chain, islice
    from sympy.ntheory import sqrt_mod_iter
    def A357099_gen(): # generator of terms
        return chain.from_iterable((sorted(filter(lambda m:1A357099_list = list(islice(A357099_gen(),30)) # Chai Wah Wu, Oct 26 2022
Showing 1-4 of 4 results.