The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A059772 Smallest prime p such that n is a solution mod p of x^2 = 2, or 0 if no such prime exists. 5

%I #18 Apr 10 2019 10:09:32

%S 0,7,7,23,17,47,31,79,0,17,71,167,97,223,127,41,23,359,199,439,241,31,

%T 41,89,337,727,0,839,449,137,73,1087,577,1223,647,1367,103,0,47,73,

%U 881,1847,967,0,151,2207,1151,2399,1249,113,193,401,0,3023,1567,191,0,71

%N Smallest prime p such that n is a solution mod p of x^2 = 2, or 0 if no such prime exists.

%C Solutions mod p are represented by integers from 0 to p-1. The following equivalences hold for n > 1: There is a prime p such that n is a solution mod p of x^2 = 2 iff n^2-2 has a prime factor > n; n is a solution mod p of x^2 = 2 iff p is a prime factor of n^2-2 and p > n. n^2-2 has at most one prime factor > n, consequently such a factor is the only prime p such that n is a solution mod p of x^2 = 2. For n such that n^2-2 has no prime factor > n (the zeros in the sequence), cf. A060515.

%H Robert Israel, <a href="/A059772/b059772.txt">Table of n, a(n) for n = 2..10000</a>

%F If n^2-2 has a (unique) prime factor p > n, then a(n) = p, else a(n) = 0.

%e a(11) = 17, since 11 is a solution mod 17 of x^2 = 2 and 11 is not a solution mod p of x^2 = 2 for primes p < 17. Although 11^2 = 2 mod 7, prime 7 is excluded because 7 < 11 and 11 = 4 mod 7.

%p f:= proc(n) local P;

%p P:= select(`>`,numtheory:-factorset(n^2-2),n);

%p if P = {} then 0 else min(P) fi

%p end proc:

%p map(f, [$2..100]); # _Robert Israel_, Feb 23 2016

%t a[n_] := Module[{P}, P = Select[FactorInteger[n^2 - 2][[All, 1]], # > n&]; If[P == {}, 0, Min[P]]];

%t Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Apr 10 2019, from Maple *)

%Y Cf. A038873, A059770, A059771, A060515.

%K nonn

%O 2,2

%A _Klaus Brockhaus_, Feb 21 2001

%E Offset corrected by _R. J. Mathar_, Aug 21 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 9 09:30 EDT 2024. Contains 373239 sequences. (Running on oeis4.)