login
Search: a042966 -id:a042966
     Sort: relevance | references | number | modified | created      Format: long | short | data
Primes p such that 2 is a square mod p; or, primes congruent to {1, 2, 7} mod 8.
+10
72
2, 7, 17, 23, 31, 41, 47, 71, 73, 79, 89, 97, 103, 113, 127, 137, 151, 167, 191, 193, 199, 223, 233, 239, 241, 257, 263, 271, 281, 311, 313, 337, 353, 359, 367, 383, 401, 409, 431, 433, 439, 449, 457, 463, 479, 487, 503, 521, 569, 577, 593, 599, 601, 607, 617
OFFSET
1,1
COMMENTS
Same as A001132 except for initial term.
Primes p such that x^2 = 2 has a solution mod p.
The primes of the form x^2 + 2xy - y^2 coincide with this sequence. These are also primes of the form u^2 - 2v^2. - Tito Piezas III, Dec 28 2008
Therefore these are composite in Z[sqrt(2)], as they can be factored as (u^2 - 2v^2)*(u^2 + 2v^2). - Alonso del Arte, Oct 03 2012
After a(1) = 2, these are the primes p such that p^4 == 1 (mod 96). - Gary Detlefs, Jan 22 2014
Also primes of the form 2v^2 - u^2. For example, 23 = 2*4^2 - 3^2. - Jerzy R Borysowicz, Oct 27 2015
Prime factors of A008865 and A028884. - Klaus Purath, Dec 07 2020
REFERENCES
W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Theorem 5-5, p. 68.
LINKS
K. S. Brown, Pythagorean graphs.
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
FORMULA
a(n) ~ 2n log n. - Charles R Greathouse IV, Nov 29 2016
MAPLE
seq(`if`(member(ithprime(n) mod 8, {1, 2, 7}), ithprime(n), NULL), n=1..113); # Nathaniel Johnston, Jun 26 2011
MATHEMATICA
fQ[n_] := MemberQ[{1, 2, 7}, Mod[n, 8]]; Select[ Prime[Range[114]], fQ] (* Robert G. Wilson v, Oct 18 2011 *)
PROG
(Magma) [ p: p in PrimesUpTo(617) | IsSquare(R!2) where R:=ResidueClassRing(p) ]; // Klaus Brockhaus, Dec 02 2008
(PARI) is(n)=isprime(n) && issquare(Mod(2, n)) \\ Charles R Greathouse IV, Apr 23 2015
(PARI) is(n)=abs(centerlift(Mod(n, 8)))<3 && isprime(n) \\ Charles R Greathouse IV, Nov 14 2017
CROSSREFS
Cf. A057126, A087780, A226523, A003629 (complement).
Primes in A035251.
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...
KEYWORD
nonn,easy
STATUS
approved
Primes == +-1 (mod 8).
(Formerly M4354 N1824)
+10
39
7, 17, 23, 31, 41, 47, 71, 73, 79, 89, 97, 103, 113, 127, 137, 151, 167, 191, 193, 199, 223, 233, 239, 241, 257, 263, 271, 281, 311, 313, 337, 353, 359, 367, 383, 401, 409, 431, 433, 439, 449, 457, 463, 479, 487, 503, 521, 569, 577, 593, 599
OFFSET
1,1
COMMENTS
Primes p such that 2 is a quadratic residue mod p.
Also primes p such that p divides 2^((p-1)/2) - 1. - Cino Hilliard, Sep 04 2004
A001132 is exactly formed by the prime numbers of A118905: in fact at first every prime p of A118905 is p = u^2 - v^2 + 2uv, with for example u odd and v even so that p - 1 = 4u'(u' + 1) + 4v'(2u' + 1 - v') when u = 2u' + 1 and v = 2v'. u'(u' + 1) is even and v'(2u' + 1 - v') is always even. At second hand if p = 8k +- 1, p has the shape x^2 - 2y^2; letting u = x - y and v = y, comes p = (x - y)^2 - y^2 + 2(x - y)y = u^2 - v^2 + 2uv so p is a sum of the two legs of a Pythagorean triangle. - Richard Choulet, Dec 16 2008
These are also the primes of form x^2 - 2y^2, excluding 2. See A038873. - Tito Piezas III, Dec 28 2008
Primes p such that p^2 mod 48 = 1. - Gary Detlefs, Dec 29 2011
Primes in A047522. - Reinhard Zumkeller, Jan 07 2012
This sequence gives the odd primes p which satisfy C(p, x = 0) = +1, where C(p, x) is the minimal polynomial of 2*cos(Pi/p) (see A187360). For the proof see a comment on C(n, 0) in A230075. - Wolfdieter Lang, Oct 24 2013
Each a(n) corresponds to precisely one primitive Pythagorean triangle. For a proof see the W. Lang link, also for a table. See also the comment by Richard Choulet above, where the case u even and v odd has not been considered. - Wolfdieter Lang, Feb 17 2015
Primes p such that p^2 mod 16 = 1. - Vincenzo Librandi, May 23 2016
Rational primes that decompose in the field Q(sqrt(2)). - N. J. A. Sloane, Dec 26 2017
REFERENCES
Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
Ronald S. Irving, Integers, Polynomials, and Rings. New York: Springer-Verlag (2004): 274.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
C. Banderier, Calcul de (2/p)
FORMULA
a(n) ~ 2n log n. - Charles R Greathouse IV, May 18 2015
MAPLE
seq(`if`(member(ithprime(n) mod 8, {1, 7}), ithprime(n), NULL), n=1..109); # Nathaniel Johnston, Jun 26 2011
for n from 1 to 600 do if (ithprime(n)^2 mod 48 = 1) then print(ithprime(n)) fi od. # Gary Detlefs, Dec 29 2011
MATHEMATICA
Select[Prime[Range[250]], MemberQ[{1, 7}, Mod[#, 8]] &] (* Harvey P. Dale, Apr 29 2011 *)
Select[Union[8Range[100] - 1, 8Range[100] + 1], PrimeQ] (* Alonso del Arte, May 22 2016 *)
PROG
(Haskell)
a001132 n = a001132_list !! (n-1)
a001132_list = [x | x <- a047522_list, a010051 x == 1]
-- Reinhard Zumkeller, Jan 07 2012
(PARI) select(p->p%8==1 ||p%8==7, primes(100)) \\ Charles R Greathouse IV, May 18 2015
(Magma) [p: p in PrimesUpTo (600) | p^2 mod 16 eq 1]; // Vincenzo Librandi, May 23 2016
CROSSREFS
For primes p such that x^m = 2 (mod p) has a solution see A001132 (for m = 2), A040028 (m = 3), A040098 (m = 4), A040159 (m = 5), A040992 (m = 6), A042966 (m = 7), A045315 (m = 8), A049596 (m = 9), A049542 (m = 10) - A049595 (m = 63). Jeff Lagarias (lagarias(AT)umich.edu) points out that all these sequences are different, although this may not be apparent from looking just at the initial terms.
Agrees with A038873 except for initial term.
Union of A007519 and A007522.
KEYWORD
nonn,nice,easy
STATUS
approved
Primes p such that x^3 = 2 has a solution mod p.
+10
29
2, 3, 5, 11, 17, 23, 29, 31, 41, 43, 47, 53, 59, 71, 83, 89, 101, 107, 109, 113, 127, 131, 137, 149, 157, 167, 173, 179, 191, 197, 223, 227, 229, 233, 239, 251, 257, 263, 269, 277, 281, 283, 293, 307, 311, 317, 347, 353, 359, 383, 389, 397, 401, 419, 431, 433
OFFSET
1,1
COMMENTS
This is the union of {3}, A003627 (primes congruent to 2 mod 3) and A014752 (primes of the form x^2+27y^2). By Thm. 4.15 of [Cox], p is of the form x^2+27y^2 if and only if p is congruent to 1 mod 3 and 2 is a cubic residue mod p. If p is not congruent to 1 mod 3, then every number is a cubic residue mod p, including 2. - Andrew V. Sutherland, Apr 26 2008
Complement of A040034 relative to A000040. - Vincenzo Librandi, Sep 13 2012
REFERENCES
David A. Cox, "Primes of the Form x^2+ny^2", 1998, John Wiley & Sons.
Kenneth Ireland and Michael Rosen, "A Classical Introduction to Modern Number Theory", second ed., 1990, Springer-Verlag.
FORMULA
a(n) ~ (3/2) n log n. - Charles R Greathouse IV, Apr 06 2022
MATHEMATICA
f[p_] := Block[{k = 2}, While[k < p && Mod[k^3, p] != 2, k++ ]; If[k == p, 0, 1]]; Select[ Prime[ Range[100]], f[ # ] == 1 &] (* Robert G. Wilson v, Jul 26 2004 *)
PROG
(Magma) [ p: p in PrimesUpTo(433) | exists(t){x : x in ResidueClassRing(p) | x^3 eq 2} ]; // Klaus Brockhaus, Dec 02 2008
(PARI) select(p->ispower(Mod(2, p), 3), primes(100)) \\ Charles R Greathouse IV, Apr 28 2015
CROSSREFS
Cf. A001132. Number of primes p < 10^n for which 2 is a cubic residue (mod p) is in A097142.
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...
KEYWORD
nonn,easy
EXTENSIONS
Typo corrected to A014752 by Paul Landon (paullandon(AT)hotmail.com), Jan 25 2010
STATUS
approved
Primes p such that x^4 = 2 has a solution mod p.
+10
23
2, 7, 23, 31, 47, 71, 73, 79, 89, 103, 113, 127, 151, 167, 191, 199, 223, 233, 239, 257, 263, 271, 281, 311, 337, 353, 359, 367, 383, 431, 439, 463, 479, 487, 503, 577, 593, 599, 601, 607, 617, 631, 647, 719, 727, 743, 751, 823, 839, 863, 881, 887, 911, 919
OFFSET
1,1
COMMENTS
For a prime p congruent to 1 mod 8, 2 is a biquadratic residue mod p if and only if there are integers x,y such that x^2 + 64*y^2 = p. 2 is also a biquadratic residue mod 2 and mod p for any prime p congruent to 7 mod 8 and for no other primes. - Fred W. Helenius (fredh(AT)ix.netcom.com), Dec 30 2004
Complement of A040100 relative to A000040. - Vincenzo Librandi, Sep 13 2012
MATHEMATICA
ok[p_] := Reduce[ Mod[x^4 - 2, p] == 0, x, Integers] =!= False; Select[ Prime[ Range[200]], ok] (* Jean-François Alcover, Dec 14 2011 *)
PROG
(Magma) [ p: p in PrimesUpTo(919) | exists(t){x : x in ResidueClassRing(p) | x^4 eq 2} ]; // Klaus Brockhaus, Dec 02 2008
(PARI) forprime(p=2, 2000, if([]~!=polrootsmod(x^4-2, p), print1(p, ", "))); print(); \\ Joerg Arndt, Jul 27 2011
CROSSREFS
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...
KEYWORD
nonn,nice,easy
STATUS
approved
Primes p such that x^5 = 2 has a solution mod p.
+10
12
2, 3, 5, 7, 13, 17, 19, 23, 29, 37, 43, 47, 53, 59, 67, 73, 79, 83, 89, 97, 103, 107, 109, 113, 127, 137, 139, 149, 151, 157, 163, 167, 173, 179, 193, 197, 199, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 277, 283, 293, 307, 313, 317, 337, 347, 349, 353
OFFSET
1,1
MATHEMATICA
ok [p_]:=Reduce[Mod[x^5- 2, p]== 0, x, Integers]=!= False; Select[Prime[Range[180]], ok] (* Vincenzo Librandi, Sep 12 2012 *)
PROG
(Magma) [p: p in PrimesUpTo(400) | exists{x: x in ResidueClassRing(p) | x^5 eq 2}]; // Bruno Berselli, Sep 12 2012
CROSSREFS
Has same beginning as A042991 but is strictly different.
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...
KEYWORD
nonn,easy
AUTHOR
STATUS
approved
Primes p such that x^49 = 2 has no solution mod p, but x^7 = 2 has a solution mod p.
+10
12
4999, 6959, 7351, 11467, 15583, 16073, 20483, 21169, 21757, 30773, 35771, 37339, 38711, 41161, 45179, 46649, 48119, 51157, 51647, 57527, 58997, 64877, 75167, 75853, 80263, 83791, 84869, 85751, 86927, 93983, 95747, 105253, 110251, 115837
OFFSET
1,1
LINKS
MATHEMATICA
Select[Prime[Range[PrimePi[120000]]], ! MemberQ[PowerMod[Range[#], 49, #], Mod[2, #]] && MemberQ[PowerMod[Range[#], 7, #], Mod[2, #]] &] (* Vincenzo Librandi, Sep 21 2013 *)
PROG
(PARI) forprime(p=2, 116000, x=0; while(x<p&&x^7%p!=2%p, x++); if(x<p, y=0; while(y<p&&y^(7^2)%p!=2%p, y++); if(y==p, print1(p, ", "))))
(PARI)
N=10^6; default(primelimit, N);
ok(p, r, k1, k2)={
if ( Mod(r, p)^((p-1)/gcd(k1, p-1))!=1, return(0) );
if ( Mod(r, p)^((p-1)/gcd(k2, p-1))==1, return(0) );
return(1);
}
forprime(p=2, N, if (ok(p, 2, 7, 7^2), print1(p, ", ")));
\\ Joerg Arndt, Sep 21 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Feb 04 2001
STATUS
approved
Primes p such that x^6 = 2 has a solution mod p.
+10
11
2, 17, 23, 31, 41, 47, 71, 89, 113, 127, 137, 167, 191, 223, 233, 239, 257, 263, 281, 311, 353, 359, 383, 401, 431, 433, 439, 449, 457, 479, 503, 521, 569, 593, 599, 601, 617, 641, 647, 719, 727, 743, 761, 809, 839, 857, 863, 881, 887, 911, 919, 929, 953
OFFSET
1,1
COMMENTS
Complement of A040993 relative to A000040. - Vincenzo Librandi, Sep 13 2012
MATHEMATICA
ok[p_]:= Reduce[Mod[x^6- 2, p] == 0, x, Integers]=!=False; Select[Prime[Range[200]], ok] (* Vincenzo Librandi, Sep 13 2012 *)
PROG
(PARI) forprime(p=2, 2000, if([]~!=polrootsmod(x^6-2, p), print1(p, ", "))); print();
/* Joerg Arndt, Jul 27 2011 */
(Magma) [p: p in PrimesUpTo(1000) | exists(t){x : x in ResidueClassRing(p) | x^6 eq 2}]; // Vincenzo Librandi, Sep 13 2012
CROSSREFS
For primes p such that x^m == 2 (mod p) has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...
KEYWORD
nonn,easy
STATUS
approved
Primes p such that x^7 = 2 has no solution mod p.
+10
4
29, 43, 71, 113, 127, 197, 211, 239, 281, 337, 379, 421, 449, 463, 491, 547, 617, 659, 701, 743, 757, 827, 883, 911, 967, 1009, 1051, 1093, 1289, 1303, 1373, 1429, 1471, 1499, 1583, 1597, 1667, 1723, 1877, 1933, 2017, 2087, 2129, 2213, 2269, 2297, 2311, 2339, 2381, 2423, 2437, 2521
OFFSET
1,1
COMMENTS
Complement of A042966 relative to A000040. Coincides for the first 96 terms with the sequence of primes p such that x^49 = 2 has no solution mod p (first divergence is at 4999, cf. A059667). - Klaus Brockhaus, Feb 04 2001
LINKS
EXAMPLE
x^7 = 2 has no solution mod 29, so 29 is in the sequence.
8^7 = 2097152 and (2097152 - 2)/31 = 67650, so 31 is not in the sequence.
MATHEMATICA
sevPow2ModPQ[p_] := Reduce[Mod[x^7 - 2, p] == 0, x, Integers] == False; Select[Prime[Range[700]], sevPow2ModPQ] (* Vincenzo Librandi, Sep 19 2012 *)
PROG
(Magma) [p: p in PrimesUpTo(3000) | forall{x: x in ResidueClassRing(p) | x^7 ne 2}]; // Vincenzo Librandi, Aug 21 2012
(Magma) [p: p in PrimesUpTo(2600) | not exists{x : x in ResidueClassRing(p) | x^7 eq 2} ]; // Vincenzo Librandi, Sep 19 2012
CROSSREFS
KEYWORD
nonn,easy
STATUS
approved
Primes p such that x^7 = 3 has a solution mod p.
+10
2
2, 3, 5, 7, 11, 13, 17, 19, 23, 31, 37, 41, 47, 53, 59, 61, 67, 73, 79, 83, 89, 97, 101, 103, 107, 109, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 199, 223, 227, 229, 233, 241, 251, 257, 263, 269, 271, 277, 283, 293, 307, 311, 313, 317
OFFSET
1,1
COMMENTS
Complement of A042969 relative to A000040.
Differs from A042966 first at index 98. - R. J. Mathar, Mar 13 2013
LINKS
MATHEMATICA
ok[p_] := Reduce[Mod[x^7 - 3, p] == 0, x, Integers] =!= False; Select[Prime[Range[150]], ok]
PROG
(Magma) [p: p in PrimesUpTo(500) | exists(t){x: x in ResidueClassRing(p) | x^7 eq 3}];
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Sep 19 2012
STATUS
approved
Primes p of the form 14*k+1 for which there is a solution to x^7 == 2 mod p.
+10
2
631, 673, 953, 1163, 1709, 2003, 2143, 2731, 2857, 3109, 3389, 3739, 4271, 4999, 5237, 5279, 5531, 5867, 6553, 6679, 6959, 7001, 7309, 7351, 7393, 8191, 8681, 9157, 9829, 10627, 10739, 11117, 11243, 11299, 11411, 11467, 13007, 13259, 15121, 15233, 15583, 16073, 18439, 18803, 20063, 20147
OFFSET
1,1
LINKS
Leonard Eugene Dickson, Cyclotomy and trinomial congruences, Transactions of the American Mathematical Society, 37.3 (1935): 363-380. See page 373.
MAPLE
ans:=[];
M:=10000;
e:=7; r:=2;
for k from 2 to M do
p:=ithprime(k);
if p mod 14 = 1 then
for x from 2 to p-1 do
if x^e mod p = r then
ans:=[op(ans), p];
break;
end if;
end do:
end if;
end do:
ans;
# Alternative:
select(p -> isprime(p) and numtheory:-mroot(2, 7, p)<>FAIL, [seq(14*i+1, i=1..3000)]); # Robert Israel, Apr 03 2018
MATHEMATICA
Select[Select[14 Range[10^3] + 1, PrimeQ], Function[p, AnyTrue[Range[2, 10^4], Mod[#^7, p] == 2 &]]] (* Michael De Vlieger, Apr 02 2016, Version 10 *)
PROG
(Magma) [p: p in PrimesUpTo(50000) | IsOne(p mod 14) and exists{x: x in ResidueClassRing(p) | x^7 eq 2}]; // Bruno Berselli, Apr 02 2016
(PARI) forprime(p=2, 10^5, if(p%14!=1, next); if(Mod(2, p)^((p-1)/7)==1, print1(p, ", "))); \\ Joerg Arndt, Apr 03 2016
CROSSREFS
Cf. A042966.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 01 2016
STATUS
approved

Search completed in 0.009 seconds