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.

A082568 First nontrivial square root of unity mod A033949(n), i.e., smallest x > 1 such that x^2 == 1 mod A033949(n).

Original entry on oeis.org

3, 5, 4, 7, 9, 8, 5, 13, 11, 15, 10, 6, 17, 14, 9, 13, 21, 19, 7, 16, 25, 21, 13, 20, 11, 8, 31, 14, 23, 33, 22, 29, 17, 26, 37, 34, 25, 9, 13, 16, 28, 21, 19, 27, 45, 32, 39, 17, 10, 49, 35, 25, 29, 53, 21, 38, 15, 37, 24, 57, 53, 50, 11, 40, 61, 55, 63, 44
Offset: 1

Views

Author

Jon Perry, May 06 2003

Keywords

Examples

			a(3) = 4 because A033949(3) = 15 and 4^2 = 16 == 1 mod 15 is the first integer to do so.
		

Crossrefs

Cf. A033949.
Column k=1 of A277776.

Programs

  • PARI
    for (n=3,100, for (j=2,n-2,if (j^2%n==1,print1(j","); break)))
    
  • Python
    from itertools import chain, count, islice
    from sympy.ntheory import sqrt_mod_iter
    def A082568_gen(): # generator of terms
        return chain.from_iterable((sorted(filter(lambda m:1A082568_list = list(islice(A082568_gen(),30)) # Chai Wah Wu, Oct 26 2022

Extensions

Offset corrected, name clarified and more terms from Alois P. Heinz, Oct 30 2016

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.