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.

Previous Showing 11-20 of 23 results. Next

A053761 Least positive integer k for which the Jacobi symbol (k|2*n-1) is less than 1, where 2*n-1 is a nonsquare; a(n)=0 if 2*n-1 is a square.

Original entry on oeis.org

0, 2, 2, 3, 0, 2, 2, 3, 3, 2, 2, 5, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 5, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 7, 5, 2, 2, 3, 0, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 7, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 5, 5, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 5, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 7, 5, 2, 2, 3
Offset: 1

Views

Author

Steven Finch, Apr 05 2000

Keywords

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 443-448.
  • Paulo Ribenboim, The New Book of Prime Number Records, 3rd ed., Springer-Verlag 1996; Math. Rev. 96k:11112.

Crossrefs

Programs

  • Maple
    A053761 := proc(n) if issqr(2*n-1) then return 0 ; else for k from 1 do if numtheory[jacobi](k,2*n-1) < 1 then return k; end if; end do: end if; end proc: seq(A053761(n),n=1..100) ; # R. J. Mathar, Aug 08 2010
  • Mathematica
    a[n_] := If[IntegerQ[Sqrt[2*n - 1]], Return[0], For[ k = 1, True, k++, If[ JacobiSymbol[k, 2*n - 1] < 1 , Return[k]]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 20 2013, after R. J. Mathar *)
  • PARI
    A112046(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(i)));
    A053761(n) = if(issquare((2*n)-1),0,A112046(n-1));
    for(n=1, 10000, write("b053761.txt", n, " ", A053761(n))); \\ Antti Karttunen, May 10 2017
    
  • Scheme
    (define (A053761 n) (if (= 1 n) 0 (* (- 1 (A010052 (+ n n -1))) (A112046 (- n 1))))) ;; Antti Karttunen, May 10 2017

Formula

a(1) = 0; for n > 1, a(n) = (1-A010052((2*n)-1)) * A112046(n-1). - Antti Karttunen, May 10 2017

Extensions

More terms from R. J. Mathar, Aug 08 2010

A222717 Primes p whose smallest positive quadratic nonresidue is not a primitive root of p.

Original entry on oeis.org

2, 41, 43, 103, 109, 151, 157, 191, 229, 251, 271, 277, 283, 307, 311, 313, 331, 337, 367, 397, 409, 439, 457, 499, 571, 643, 683, 691, 727, 733, 739, 761, 769, 811, 911, 919, 967, 971, 991, 997, 1013, 1021, 1031, 1051, 1069, 1093, 1151, 1163, 1181, 1289
Offset: 1

Views

Author

Jonathan Sondow, Mar 12 2013

Keywords

Comments

Same as primes p such that if q is the smallest positive quadratic nonresidue mod p, then either q == 0 mod p or q^k == 1 mod p for some positive integer k < p-1.
A primitive root of an odd prime p is always a quadratic nonresidue mod p. (Proof. If g == x^2 mod p, then g^((p-1)/2) == x^(p-1) == 1 mod p, and so g is not a primitive root of p.) But a quadratic nonresidue mod p may or may not be a primitive root of p.
Supersequence of A047936 = primes whose smallest positive primitive root is not prime. (Proof. If p is not in A222717, then the smallest positive quadratic nonresidue of p is a primitive root g. Since the smallest positive quadratic nonresidue is always a prime, g is prime. But since all primitive roots are quadratic nonresidues, g is the smallest positive primitive root of p. Hence p is not in A047936.)
See A001918 (least positive primitive root of the n-th prime) and A053760 (smallest positive quadratic nonresidue of the n-th prime) for references and additional comments and links.

Examples

			The smallest positive quadratic nonresidue of 2 is 2 itself, and 2 is not a primitive root of 2, so 2 is a member.
The smallest positive quadratic nonresidue of 41 is 3, and 3 is not a primitive root of 41, so 41 is a member.
		

Crossrefs

Programs

  • Mathematica
    nn = 300; NR = (Table[p = Prime[n]; First[ Select[ Range[p], JacobiSymbol[#, p] != 1 &]], {n, nn}]); Select[ Prime[ Range[nn]], Mod[ NR[[PrimePi[#]]], #] == 0 || MultiplicativeOrder[ NR[[PrimePi[#]]], #] < # - 1 &]

A307767 The "non-residue" pseudoprimes: odd composite numbers n such that b(n)^((n-1)/2) == -1 (mod n), where base b(n) = A020649(n).

Original entry on oeis.org

3277, 3281, 29341, 49141, 80581, 88357, 104653, 121463, 196093, 314821, 320167, 458989, 476971, 489997, 491209, 721801, 800605, 838861, 873181, 877099, 973241, 1004653, 1251949, 1268551, 1302451, 1325843, 1373653, 1397419, 1441091, 1507963, 1509709, 1530787, 1590751, 1678541, 1809697
Offset: 1

Views

Author

Thomas Ordowski, Apr 27 2019

Keywords

Comments

As is well known, for an odd prime p, b(p) is the smallest quadratic non-residue b modulo p if and only if b(p) is the smallest base b such that b^((p-1)/2) == -1 (mod p). Note that b(n) is always a prime.
Conjecture: If 2^((n-1)/2) == -1 (mod n), then b(n) = 2, where b(n) as above. This is true for odd primes n; is it for odd composites n? If so, then all composite numbers n such that 2^((n-1)/2) == -1 (mod n) are in this sequence.
It seems that, for defined pseudoprimes n (similar to the odd primes p),
b(n) is the smallest base b such that b^((n-1)/2) == -1 (mod n), although this is not required by their definition.
Note: a "non-residue" pseudoprime n is a strong pseudoprime to base b(n); the Jacobi symbol (b(n)/n) = -1, where b(n) is the smallest non-residue modulo n; such a pseudoprime n is not a Proth number, so n = k*2^m + 1 with odd k > 2^m.
Problem: are there infinitely many such numbers?

Examples

			2^((3277-1)/2) == -1 (mod 3277), 3^((3281-1)/2) == -1 (mod 3281), ...
		

Crossrefs

Cf. A001262, A006970, A020649, A047713, A053760, A244626, A307798 (the "residue" pseudoprimes), A307809.

Programs

  • Mathematica
    residueQ[n_, m_] := Module[{ans = 0}, Do[If[Mod[k^2, m] == n, ans = True; Break[]], {k, 0, Floor[m/2]}]; ans]; A020649[n_] := Module[{m = 0}, While[ residueQ[m, n], m++]; m]; aQ[n_] := CompositeQ[n] && PowerMod[A020649[n], ((n - 1)/2), n] == n - 1; Select[Range[3, 110000, 2], aQ] (* Amiram Eldar, Apr 27 2019 *)

Extensions

More terms from Amiram Eldar, Apr 27 2019

A147972 Smallest prime p modulo which the first n primes are nonzero quadratic residues.

Original entry on oeis.org

7, 23, 71, 311, 479, 1559, 5711, 10559, 18191, 31391, 366791, 366791, 366791, 3818929, 9257329, 22000801, 36415991, 48473881, 120293879, 120293879, 131486759, 131486759, 2929911599, 2929911599, 7979490791, 23616331489, 23616331489, 89206899239, 121560956039, 196265095009, 196265095009, 513928659191, 5528920734431, 8402847753431, 8402847753431, 8402847753431, 70864718555231
Offset: 1

Views

Author

Max Alekseyev, Nov 18 2008

Keywords

Comments

The same primes without repetitions are listed in A147970.
a(n) <= min{A002223(n), A002224(n)}. What is the smallest n for which this inequality is strict?
By definition, a(n) == 1, 7 (mod 8), so a(n) = min{A002223(n), A002224(n)}. - Jianing Song, Feb 18 2019

Crossrefs

Smallest prime p such that each of the first n primes has q q-th roots mod p: this sequence (q=2), A002225 (q=3), A002226 (q=5), A002227 (q=7), A002228 (q=11), A060363 (q=13), A060364 (q=17).

Programs

  • Mathematica
    (*version 7.0*)m=1;P=7;Lst={p};While[m<25,m++;S=Prime[Range[m]];While[MemberQ[JacobiSymbol[S,p],-1],p=NextPrime[p]];Lst=Append[Lst,P]];Lst (* Emmanuel Vantieghem, Jan 31 2012 *)
  • PARI
    t=2;forprime(p=2,1e9,forprime(q=2,t,if(kronecker(q,p)<1,next(2)));print1(p", ");t=nextprime(t+1);p--) \\ Charles R Greathouse IV, Jan 31 2012

Formula

a(n) >= min{A002189(n-1), A045535(n-1)}. - Jianing Song, Feb 18 2019

Extensions

a(23)-a(25) from Emmanuel Vantieghem, Jan 31 2012
a(26)-a(37) from Max Alekseyev, Aug 21 2015

A223036 Primes p whose smallest positive quadratic nonresidue is a primitive root of p.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 139, 149, 163, 167, 173, 179, 181, 193, 197, 199, 211, 223, 227, 233, 239, 241, 257, 263, 269, 281, 293, 317, 347, 349, 353, 359, 373, 379, 383
Offset: 1

Views

Author

Jonathan Sondow, Mar 13 2013

Keywords

Comments

See the complementary sequence A222717 for comments.

Examples

			The smallest positive quadratic nonresidue of 3 is 2, and 2 is a primitive root of 3, so 3 is a member.
		

Crossrefs

Programs

  • Mathematica
    nn = 100; NR = (Table[p = Prime[n]; First[ Select[ Range[p], JacobiSymbol[#, p] != 1 &]], {n, nn}]); Select[ Prime[ Range[nn]], MultiplicativeOrder[ NR[[PrimePi[#]]], #] == # - 1 &]

A248972 a(n) is the smallest b such that b^((p-1)/2) == -1 (mod p) where p = A080076(n) is the n-th Proth prime.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Oct 18 2014

Keywords

Comments

Proth's theorem asserts that p=1+k*2^m (with odd k < 2^m) is prime if there exists b such that b^((p-1)/2) == -1 (mod n). This sequence lists the smallest b which certifies primality of A080076(n) via this relation.
For n > 3, a(n) is an odd prime. - Thomas Ordowski, Apr 23 2019

Crossrefs

Cf. A080076.
A subsequence of A020649 and of A053760.

Programs

Formula

a(n) = A020649(A080076(n)) = A053760(k), where prime(k) = A080076(n). - Thomas Ordowski, Apr 23 2019

A307865 a(n) is the number of natural bases b < 2n+1 such that b^n == -1 (mod 2n+1).

Original entry on oeis.org

0, 1, 2, 3, 0, 5, 6, 1, 8, 9, 0, 11, 0, 1, 14, 15, 0, 1, 18, 1, 20, 21, 0, 23, 0, 1, 26, 1, 0, 29, 30, 1, 0, 33, 0, 35, 36, 1, 0, 39, 0, 41, 4, 1, 44, 9, 0, 1, 48, 1, 50, 51, 0, 53, 54, 1, 56, 1, 0, 1, 0, 1, 2, 63, 0, 65, 0, 1, 68, 69, 0, 1, 0, 1, 74, 75, 0, 1, 78, 1, 0, 81, 0, 83, 0, 1, 86
Offset: 0

Views

Author

Thomas Ordowski, May 02 2019

Keywords

Comments

For n > 0, a(n) = n if and only if 2n+1 is prime.
Note that a(n) < n if and only if 2n+1 is composite.
Conjecture: if 2n+1 is an absolute Euler pseudoprime, then a(n) = 0.

Crossrefs

Programs

  • Mathematica
    a[n_] := Length[Select[Range[2n], PowerMod[#, n, 2n+1] == 2n &]]; Array[a, 100] (* Amiram Eldar, May 02 2019 *)
  • PARI
    a(n) = sum(b=1, 2*n, Mod(b, 2*n+1)^n == -1); \\ Michel Marcus, May 02 2019

Extensions

More terms from Amiram Eldar, May 02 2019

A309680 The smallest nonsquare nonzero integer that is a quadratic residue modulo n, or 0 if no such integer exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 3, 2, 0, 7, 5, 3, 0, 3, 2, 6, 0, 2, 7, 5, 5, 7, 3, 2, 12, 6, 3, 7, 8, 5, 6, 2, 17, 3, 2, 11, 13, 3, 5, 3, 20, 2, 7, 6, 5, 10, 2, 2, 33, 2, 6, 13, 12, 6, 7, 5, 8, 6, 5, 3, 21, 3, 2, 7, 17, 10, 3, 6, 8, 3, 11, 2, 28, 2, 3, 6, 5, 11, 3, 2, 20, 7
Offset: 1

Views

Author

John Prosser, Aug 12 2019

Keywords

Examples

			For n=5, the nonzero quadratic residues modulo 5 are 1 and 4. Since these are both squares we have a(5) = 0.
For n=6, the nonzero quadratic residues modulo 6 are 1,3, and 4. Since 3 is not a square we have a(6) = 3.
For n=10, the nonzero quadratic residues modulo 10 are 1,4,5,6,9. Since 5 is the least nonsquare value, we have a(10) = 5.
		

Crossrefs

A330404 is an alternate version.

Programs

  • Mathematica
    a[n_] := SelectFirst[ Union@ Mod[Range[n-1]^2, n], ! IntegerQ@ Sqrt@ # &, 0]; Array[a, 81] (* Giovanni Resta, Aug 13 2019 *)
  • PARI
    a(n) = my(v=select(x->issquare(x), vector(n-1, k, Mod(k,n)), 1), y = select(x->!issquare(x), Vec(v))); if (#y, y[1], 0); \\ Michel Marcus, Aug 16 2019

Formula

a(n) = 2 for n in A057126 and n > 2. - Michel Marcus, Aug 24 2019

A330406 a(n) is the smallest prime q such that q^((p-1)/2) == -1 (mod p), where p = A002144(n) is the n-th prime congruent to 1 mod 4.

Original entry on oeis.org

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

Views

Author

Nicholas C. Singer, Dec 13 2019

Keywords

Comments

Subset of A053760 corresponding to p == 1 (mod 4).
A002144(n) = p is a sum of two integer squares (Fermat): p = a^2 + b^2. To find a and b, calculate gcd(p, A330406(n)^((p-1)/4)+i) = a + bi in the Gaussian integers.

Examples

			Let p = A002144(30)= 313. Then (p-1)/2 = 156. Now 2^156 == 3^156 == 1 (mod p) but 5^156 == -1 (mod p).  Thus A330406(30)=5.
		

Crossrefs

Programs

  • Mathematica
    Map[Block[{q = 2}, While[PowerMod[q, (# - 1)/2, #] != # - 1, q = NextPrime@ q]; q] &, Select[4 Range[350] + 1, PrimeQ]] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    A002144 = select(p->p%4==1, primes(2200));
    A330406 = vector(1000); for(i=1, 1000, my(p=A002144[i]); forprime(j=1, 20, my(x=Mod(j, p)^((p-1)/2)); if(x+1, , A330406[i]=j; break)))
    A330406

A162541 Primes p such that a splitting of the cyclic group Zp by the perfect 3-shift code {+-1,+-2,+-3} exists.

Original entry on oeis.org

7, 37, 139, 163, 181, 241, 313, 337, 349, 379, 409, 421, 541, 571, 607, 631, 751, 859, 877, 937, 1033, 1087, 1123, 1171, 1291, 1297, 1447, 1453, 1483, 1693, 1741, 1747, 2011, 2161, 2239, 2311, 2371, 2473, 2539, 2647, 2677, 2707, 2719, 2857, 3169, 3361, 3433, 3511, 3547
Offset: 1

Views

Author

Ctibor O. Zizka, Jul 05 2009

Keywords

Comments

This list was computed by S. Saidi.
From Travis Scott, Oct 04 2022: (Start)
These are also the p whose (phi/3)-th power residues have minimal bases at {1,2,3} (see under Example). Such covers {1
a(n)-> {1,2,3}(n) = 7, 37, 139, 163, 181, 241, ... ~ (9*n)*log(n)
{1,2,4}(n) = 13, 19, 61, 67, 73, 79, ... ~ (9*n/2)*log(n)
{1,3,5}(n) = 31, 223, 229, 277, 283, 397, ... ~ (27*n)*log(n)
{1,3,7}(n) = 43, 433, 457, 691, 1069, 1471, ... ~ (81*n/2)*log(n)
{1,3,9}(n) = 109, 127, 157, 601, 733, 739, ... ~ (81*n/4)*log(n)
{1,5,7}(n) = 307, 919, 1093, 2179, 2251, 3181, ... ~ (81*n)*log(n)
Note that the k-th q value takes A054272(k) x values and that a(n) = A040034(n) \ {1,2,4}(n). Following a result of Erdős (cf. A053760, A098990) the asymptotic means for q and x are Sum_{n>=1} prime(n)*2/3^n = 2.69463670741804726229622... and Sum_{n>=1} Sum_{prime(n) < k prime < prime(n)^2 OR k = prime(n)^2} D(prime(n),k)*k = 5.69767191389790422108748...
Subsequence of A040034 (2 is not a cubic residue modulo p) such that 3 is neither a residue nor in the same cubic power class as 2. (End)

Examples

			From _Travis Scott_, Oct 04 2022: (Start)
{1,2,3}^12 (mod 37) == {1,26,10} covers the 12th-power residues on Z/37Z.
{1,2,3}^14 (mod 43) == {1,1,36} misses 6. (End)
		

Crossrefs

Subsequence of A040034.

Programs

  • Mathematica
    Select[Prime@Range@497,Mod[#,3]==1&&DuplicateFreeQ@PowerMod[{1,2,3},(#-1)/3,#]&] (* Travis Scott, Oct 04 2022 *)

Formula

From Travis Scott, Oct 04 2022: (Start)
Primes of quadratic form 7x^2 +- 6xy + 36y^2 [from Saidi].
a(n) ~ 9*n*log(n). (End)

Extensions

Incorrect term deleted and more terms from Travis Scott, Oct 04 2022
Previous Showing 11-20 of 23 results. Next