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

A306530 a(n) is the smallest prime q such that Kronecker(q, prime(n)) = 1.

Original entry on oeis.org

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

Views

Author

Jianing Song, Feb 22 2019

Keywords

Comments

For n >= 2, a(n) is the smallest prime quadratic residue modulo the n-th prime.
Also for n >= 2, a(n) is the smallest prime that decomposes in the quadratic field Q[sqrt((-1)^((p-1)/2)*p)], p = prime(n). Using this definition, a(1) should have been 5 because for p = 2, Q[sqrt((-1)^((p-1)/2)*p)] = Q[sqrt(2*i)] = Q[1+i] = Q[i], in which 5 decomposes.
For most n, a(n) is relatively small. Among [1, 10000], there are only 669 n's that violate a(n) < prime(n)/n and 97 n's > 1 that violate a(n) < prime(n)*log(log(n))/n. In fact, if we ignore the first three terms, the only terms among the first 10000 ones that seem unusually large are a(14) = 11, a(19) = 17, a(38) = 41, a(62) = 17, a(1137) = 29, a(1334) = 29, a(3935) = 37, a(7309) = 43, a(8783) = 37 and a(8916) = 41, with the corresponding primes 43, 67, 163, 293, 9173, 10987, 37123, 74093, 90787, 92333.
For every prime p there are infinitely many n such that a(n)=p. Indeed, using quadratic reciprocity, for each prime p_j <= p we can choose k_j coprime to p_j, such that p_j is a quadratic nonresidue (if p_j < p) or residue (if p_j = p) mod q for every prime q == k_j (mod p_j). Dirichlet's theorem on primes in arithmetic progressions implies there are infinitely many primes q with q == k_j (mod p_j) for all j. Then a(n) = p where q = prime(n). - Robert Israel, Mar 26 2019
a(n) is the smallest prime q such that the congruence x^2 == q (mod p) has a solution x, where p = prime(n). For n > 1, a(n) is the smallest prime q such that q^((p-1)/2) == 1 (mod p), where odd p = prime(n). - Thomas Ordowski, Apr 29 2019

Examples

			2, 3, 5, 7, ..., 37 are all quadratic nonresidues modulo prime(38) = 163, while 41 is a quadratic residue modulo 163, so a(38) = 41.
		

Crossrefs

Cf. A053760 (smallest (prime) quadratic nonresidue modulo prime(n)).
Cf. A024704 (a(n)=2).

Programs

  • Maple
    f:= proc(n) local q,p;
      q:= ithprime(n);
      p:= 1:
      do
        p:= nextprime(p);
        if numtheory:-jacobi(p,q)=1 then return p fi
      od;
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 26 2019
  • Mathematica
    a[n_] := Module[{i = 1}, While[KroneckerSymbol[Prime[i], Prime[n]] != 1, i++]; Prime[i]];
    Array[a, 100] (* Jean-François Alcover, Jun 08 2020, after PARI *)
  • PARI
    a(n)=my(i=1);while(kronecker(prime(i),prime(n))!=1,i++);prime(i)

A120947 a(n) = smallest m such that n-th prime divides Pell(m).

Original entry on oeis.org

2, 4, 3, 6, 12, 7, 8, 20, 22, 5, 30, 19, 10, 44, 46, 27, 20, 31, 68, 70, 36, 26, 84, 44, 48, 51, 34, 108, 55, 28, 126, 132, 17, 140, 75, 150, 79, 164, 166, 87, 36, 91, 190, 96, 9, 18, 212, 74, 76, 23, 116, 14, 40, 84, 64, 262, 15, 270, 139, 140, 284, 49, 308, 310, 78, 159, 332
Offset: 1

Views

Author

Ralf Stephan, Aug 19 2006

Keywords

Comments

For all divisors d of n>0, Pell(d) divides Pell(n), so if a prime divides the n-th Pell number, so does it for all multiples of n.
For n > 1, a(n) is the multiplicative order of -3-2*sqrt(2), in GF(prime(n)) if 2 is a quadratic residue (mod prime(n)) or GF(prime(n)^2) otherwise. Thus a(n) divides prime(n)-1 if prime(n) == 1 or 7 (mod 8), i.e. n is in A024704, and a(n) divides prime(n)+1 if prime(n) == 3 or 5 (mod 8), i.e. n is 2 or is in A024705. - Robert Israel, Aug 28 2015

Examples

			a(4)=6 because the 6th Pell number, 70, is the first that is divisible by the 4th prime (=7).
		

Crossrefs

Cf. A000129 (Pell numbers), A001602 (equivalent sequence with Fibonacci numbers), A239111, A024704, A024705.

Programs

  • Maple
    p:= proc(n) p(n):=`if`(n<2, n, 2*p(n-1)+p(n-2)) end:
    a:= proc(n) local k, t; t:= ithprime(n);
          for k while irem(p(k), t)>0 do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 28 2014
    f:= proc(n)
    local p, r, G;
    uses numtheory;
    p:= ithprime(n);
    if quadres(2,p)=1 then
       r:= msqrt(2,p);
       order(-3-2*r, p)
    else
       G:= GF(p, 2, r^2-2);
       G:-order( G:-ConvertIn(-3-2*r));
    fi
    end proc:
    2, seq(f(n), n=2..100); # Robert Israel, Aug 28 2015
  • Mathematica
    p[n_] := p[n] = If[n<2, n, 2*p[n-1] + p[n-2]]; a[n_] := Module[{k, t}, t = Prime[n]; For[k=1, Mod[p[k], t]>0, k++]; k]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 16 2015, after Alois P. Heinz *)
  • PARI
    a(n,p=prime(n))=my(cur=Mod(1,p),last,m=1); while(cur, m++; [last,cur]=[cur,2*cur+last]); m \\ Charles R Greathouse IV, Jun 16 2015
Showing 1-2 of 2 results.