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-8 of 8 results.

A144295 Where records occur in A144294.

Original entry on oeis.org

1, 2, 4, 12, 82, 231, 380, 2990, 20954, 40953, 42852, 182492, 859647, 8039644, 11990003, 78269808, 3263358159, 6941215856
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2008

Keywords

Crossrefs

Programs

  • PARI
    f(n)=my(k=n+(sqrtint(4*n)+1)\2); forprime(p=2, , if(!issquare(Mod(k, p)), return(p))); \\ A144294
    lista(nn) = {my(v=vector(nn, n, f(n))); my(m=0, nm=0); for (n=1, nn, nm = v[n]; if (nm > m, print1(n, ", "); m = nm;););} \\ Michel Marcus, Jun 25 2021

Extensions

a(9)-a(12) from R. J. Mathar, Dec 04 2008
a(13)-a(15) from Michel Marcus, Jun 25 2021
a(16)-a(18) from Michael S. Branicky, Sep 30 2024

A144296 Records in A144294.

Original entry on oeis.org

3, 5, 7, 13, 17, 19, 31, 41, 43, 47, 53, 71, 79, 89, 103, 127, 131, 137
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2008

Keywords

Crossrefs

Programs

  • PARI
    f(n)=my(k=n+(sqrtint(4*n)+1)\2); forprime(p=2, , if(!issquare(Mod(k, p)), return(p))); \\ A144294
    lista(nn) = {my(v=vector(nn, n, f(n))); my(m=0, nm=0); for (n=1, nn, nm = v[n]; if (nm > m, print1(nm, ", "); m = nm;););} \\ Michel Marcus, Jun 25 2021

Extensions

a(9)-a(12) from R. J. Mathar, Dec 04 2008
a(13)-a(15) from Michel Marcus, Jun 25 2021
a(16)-a(18) from Michael S. Branicky, Sep 30 2024

A092419 Let k = n-th nonsquare = A000037(n); then a(n) = smallest prime p such that the Kronecker-Jacobi symbol K(k,p) = -1.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 16 2008

Keywords

Comments

Maple calls K(k,p) the Legendre symbol.
The old entry with this sequence number was a duplicate of A024356.

References

  • H. Cohen, A Course in Computational Number Theory, Springer, 1996 (p. 28 defines the Kronecker-Jacobi symbol).

Crossrefs

Cf. A000037. Records: A067073, A070040. See A144294 for another version.

Programs

  • Maple
    with(numtheory); f:=proc(n) local M,i,j,k; M:=100000; for i from 1 to M do if legendre(n,ithprime(i)) = -1 then RETURN(ithprime(i)); fi; od; -1; end;
  • PARI
    a(n)=my(k=n+(sqrtint(4*n)+1)\2); forprime(p=2,, if(kronecker(k,p)<0, return(p))) \\ Charles R Greathouse IV, Aug 28 2016

Extensions

Definition corrected Dec 03 2008

A094928 Let p = n-th prime == 1 mod 8 (A007519); a(n) = smallest prime q such that p is not a square mod q.

Original entry on oeis.org

3, 3, 5, 3, 5, 3, 3, 5, 3, 7, 3, 3, 5, 5, 3, 3, 7, 5, 3, 5, 3, 3, 5, 3, 7, 3, 3, 5, 3, 7, 3, 3, 3, 3, 5, 3, 3, 11, 5, 3, 3, 11, 5, 3, 11, 3, 7, 3, 5, 7, 3, 3, 3, 3, 7, 3, 3, 7, 5, 3, 3, 5, 5, 11, 5, 3, 3, 5, 5, 3, 7, 5, 3, 5, 3, 7, 3, 7, 3, 5, 3, 3, 3, 5, 11, 5, 3, 5, 3, 3, 13, 5, 3, 3, 3, 3, 5, 5, 3, 5, 3, 7
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2004

Keywords

Examples

			n=3, p = 73, a(3) = q = 5: Legendre(73,5) = -1.
		

References

  • M. Kneser, Quadratische Formen, Springer, 2002; see Hilfssatz 18.3.

Crossrefs

Subsequence of A094929.

Programs

  • Maple
    f:= proc(p) local q;
         q:= 3:
         do
          if numtheory:-quadres(p,q) = -1 then return q fi;
          q:= nextprime(q);
         od;
    end proc:
    map(f, select(isprime, [seq(p,p=1..10000,8)])); # Robert Israel, May 06 2019
  • Mathematica
    f[n_] := Prime[ Position[ JacobiSymbol[n, Select[Range[3, n - 1], PrimeQ[ # ] &]], -1][[1, 1]] + 1]; f /@ Select[ Prime[ Range[435]], Mod[ #, 8] == 1 &] (* Robert G. Wilson v, Jun 23 2004 *)

Formula

a(n) = A094929(A269704(n)). - Robert Israel, May 06 2019

Extensions

More terms from Robert G. Wilson v, Jun 23 2004

A377212 a(n) is the least number k that is not a quadratic residue modulo prime(n) but is a quadratic residue modulo all previous primes.

Original entry on oeis.org

2, 3, 6, 21, 15, 91, 246, 429, 1005, 399, 3094, 3045, 21099, 41155, 43059, 404754, 214230, 569130, 182919, 2190279, 860574, 9361374, 8042479, 33440551, 36915670, 11993466, 287638530, 182528031, 697126530, 78278655, 3263415285, 6941299170, 25856763139, 32968406926, 13803374706
Offset: 2

Views

Author

Robert Israel, Oct 19 2024

Keywords

Comments

a(n) = A000037(j) for the least j such that A144294(j) = prime(n).
Such numbers k exist for all n >= 2: for example, if x is a quadratic nonresidue modulo prime(n), by the Chinese Remainder Theorem there exists k such that k == x (mod prime(n)) and k == 1 (mod prime(j)) for 1 <= j < n.

Examples

			a(4) = 6 because 6 is not a quadratic residue modulo 7, but is a quadratic residue modulo 2, 3, and 5, and no smaller number works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,p;
      if issqr(n) then return -1 fi;
      p:= 1;
      for k from 1 do
          p:= nextprime(p);
          if numtheory:-quadres(n,p) = -1 then return k fi
      od
    end proc:
    V:= Array(2..32): count:= 0:
    for k from 2 while count < 31 do
      v:= f(k);
    if v > 0 and v <= 32 and V[v] = 0 then
      V[v]:= k; count:= count+1
    fi
    od:
    convert(V,list);
  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import prime, nextprime, legendre_symbol
    def A377212(n):
        p = prime(n)
        for r in count(1):
            k, q = r+(m:=isqrt(r))+(r>=m*(m+1)+1), 2
            while (q:=nextprime(q)):
                if q>p or legendre_symbol(k,q)==-1:
                    break
            if p==q:
                return k # Chai Wah Wu, Oct 20 2024

Extensions

a(33)-a(36) from Chai Wah Wu, Oct 21 2024

A139401 If n is a square, a(n) is 0. Otherwise, a(n) is the smallest number k such that n is not a quadratic residue modulo k.

Original entry on oeis.org

0, 3, 4, 0, 3, 4, 4, 3, 0, 4, 3, 5, 5, 3, 4, 0, 3, 4, 4, 3, 8, 4, 3, 7, 0, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 0, 5, 3, 4, 7, 3, 4, 4, 3, 7, 4, 3, 5, 0, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 9, 7, 3, 4, 0, 3, 4, 4, 3, 7, 4, 3, 5, 5, 3, 4, 7, 3, 4, 4, 3, 0, 4, 3, 9, 8, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 7, 5, 3, 4, 0, 3, 4, 4, 3, 9
Offset: 1

Views

Author

J. Lowell, Jun 09 2008, Jun 10 2008

Keywords

Comments

I.e., if n is not a square, a(n) is the smallest number d for which a sequence that has a common difference of d contains n but that has no squares.
All nonzero values in this sequence are at least 3.
All nonzero values are prime powers, and every prime power except 2 appears in the sequence. This can be proved using the Chinese remainder theorem. - Franklin T. Adams-Watters, Jun 10 2011
Records of nonzero values in this sequence are in A066730.

Examples

			a(2) = 3 because there are no squares in the sequence 2, 5, 8, 11, 14, 17, 20, ...
		

Crossrefs

Programs

  • PARI
    a(n) = if (issquare(n), 0, my(k=2); while (issquare(Mod(n, k)), k++); k); \\ Michel Marcus, Jun 25 2021
  • Python
    import math
    def A139401(n):
        if int(math.sqrt(n)) == math.sqrt(n):
            return 0
        for pp in range(2, n + 2):  # only really need to check prime powers
            residues = frozenset(pow(k, 2, pp) for k in range(pp))
            if n % pp not in residues:
                return pp  # Dan Uznanski, Jun 22 2021
    

Extensions

More terms from John W. Layman, Jun 17 2008
New name from Franklin T. Adams-Watters, Jun 10 2011

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.

A306224 a(n) is the smallest prime p such that -n is not a square mod p.

Original entry on oeis.org

3, 5, 5, 3, 11, 13, 3, 5, 7, 3, 7, 5, 3, 11, 7, 3, 5, 5, 3, 11, 13, 3, 5, 13, 3, 11, 5, 3, 7, 7, 3, 5, 5, 3, 19, 7, 3, 5, 7, 3, 13, 5, 3, 7, 11, 3, 5, 5, 3, 7, 7, 3, 5, 13, 3, 11, 5, 3, 11, 7, 3, 5, 5, 3, 7, 19, 3, 5, 11, 3, 7, 5, 3, 7, 11, 3, 5, 5, 3, 11, 7, 3, 5, 13, 3, 7, 5
Offset: 1

Views

Author

Jianing Song, Jan 30 2019

Keywords

Comments

a(n) is the smallest odd prime p such that Kronecker(-n,p) = -1.
A companion sequence to A144294.
Conjecture: lim sup log(a(n))/log(n) = 0.

Crossrefs

Cf. A144294.
See A306220 for another version.

Programs

  • PARI
    a(n) = forprime(p=3, , if(kronecker(-n, p)<0, return(p)))

Formula

a(n) = 3 if and only if n == 1 (mod 3).
a(n) = 5 if and only if n == 2, 3, 8, 12 (mod 15).
Showing 1-8 of 8 results.