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
REFERENCES
W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Theorem 5-5, p. 68.
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,easy
AUTHOR
STATUS
approved