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.

A373088 a(n) = min{k : KroneckerSymbol(n, k) = -1} if n is not a square, 0 otherwise.

Original entry on oeis.org

0, 0, 3, 2, 0, 2, 7, 5, 3, 0, 7, 2, 5, 2, 3, 13, 0, 3, 5, 2, 3, 2, 5, 3, 7, 0, 3, 2, 5, 2, 11, 7, 3, 5, 7, 2, 0, 2, 3, 11, 7, 3, 5, 2, 3, 2, 11, 3, 5, 0, 3, 2, 5, 2, 7, 7, 3, 5, 5, 2, 13, 2, 3, 5, 0, 3, 7, 2, 3, 2, 13, 3, 5, 5, 3, 2, 7, 2, 5, 11, 3, 0, 5, 2
Offset: 0

Views

Author

Peter Luschny, May 26 2024

Keywords

Crossrefs

Similar: A092419, A144294.
Cf. A372728.

Programs

  • Maple
    K := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
    a := proc(n) if issqr(n) then return 0 fi;
    local k; k := 0;
        while true do
            if K(n, k) = -1 then return k fi;
            k := k + 1;
    od; -1; end:
    seq(a(n), n = 0..83);
  • PARI
    a(n) = if (issquare(n), 0, my(k=1); while (kronecker(n,k) != -1, k++); k); \\ Michel Marcus, May 31 2024
  • SageMath
    def A373088(n):
        if is_square(n): return 0
        k = 0
        while True:
            if kronecker_symbol(n, k) == -1:
                return k
            k += 1
        return k
    print([A373088(n) for n in range(83)])
    

Formula

If n is not a square then a(n) is a prime number.