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.

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).