|
|
A088192
|
|
Distance between prime(n) and the largest quadratic residue modulo prime(n).
|
|
14
|
|
|
1, 2, 1, 3, 2, 1, 1, 2, 5, 1, 3, 1, 1, 2, 5, 1, 2, 1, 2, 7, 1, 3, 2, 1, 1, 1, 3, 2, 1, 1, 3, 2, 1, 2, 1, 3, 1, 2, 5, 1, 2, 1, 7, 1, 1, 3, 2, 3, 2, 1, 1, 7, 1, 2, 1, 5, 1, 3, 1, 1, 2, 1, 2, 11, 1, 1, 2, 1, 2, 1, 1, 7, 3, 1, 2, 5, 1, 1, 1, 1, 2, 1, 7, 1, 3, 2, 1, 1, 1, 3, 2, 13, 3, 2, 2, 5, 1, 1, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
a(n) = smallest m>0 such that -m is a quadratic residue modulo prime(n).
a(n) = smallest m>0 such that prime(n) either splits or ramifies in the imaginary quadratic field Q(sqrt(-m)). Equals -A220862(n) except when n = 1. Cf. A220861, A220863. - N. J. A. Sloane, Dec 26 2012
The values are 1 or a prime number (easily provable!). The maximum occurring prime values increase very slowly: up to 10^5 terms the largest prime is 43. The primes do not appear in order.
|
|
REFERENCES
|
David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, Cor. 5.17, p. 105. - From N. J. A. Sloane, Dec 26 2012
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
a[n_] := With[{p = Prime[n]}, If[JacobiSymbol[-1, p] > 0, 1, For[d = 2, True, d = NextPrime[d], If[JacobiSymbol[-d, p] >= 0, Return[d]]]]]; Array[a, 100] (* Jean-François Alcover, Feb 16 2018, after Charles R Greathouse IV *)
|
|
PROG
|
(PARI) qrp_pm(fr, to)= {/* The distance of largest QR modulo the primes from the primes */ local(m, p, v=[]); for(i=fr, to, m=1; p=prime(i); j=2; while((j<=(p-1)/2)&&(m<p-1), m=max(m, (j^2)%p); j++); v=concat(v, p-m)); print(v) }
(PARI) do(p)=if(kronecker(-1, p)>0, 1, forprime(d=2, p, if(kronecker(-d, p) >= 0, return(d))))
|
|
CROSSREFS
|
Records are (essentially) given by A147971.
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
Ferenc Adorjan (fadorjan(AT)freemail.hu), Sep 22 2003
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|