A059771 Second solution of x^2 = 2 mod p for primes p such that a solution exists.
0, 4, 11, 18, 23, 24, 40, 59, 41, 70, 64, 83, 65, 62, 111, 106, 105, 154, 134, 141, 179, 208, 148, 140, 219, 197, 153, 175, 149, 245, 193, 311, 186, 340, 288, 246, 348, 312, 243, 227, 418, 419, 377, 260, 292, 396, 346, 272, 368, 543, 451, 433, 379, 413, 321
Offset: 1
Examples
a(6) = 24 since 41 is the sixth term of A038873, 17 and 24 are the solutions mod 41 of x^2 = 2 and 24 is the larger one.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
R:= 0: p:= 2: count:= 1: while count < 100 do p:= nextprime(p); if NumberTheory:-QuadraticResidue(2,p)=1 then v:= NumberTheory:-ModularSquareRoot(2,p); R:= R, max(v,p-v); count:= count+1 fi od: R; # Robert Israel, Sep 07 2023
Formula
a(n) = second (larger) solution of x^2 = 2 mod p, where p is the n-th prime such that x^2 = 2 mod p has a solution, i.e. p is the n-th term of A038873. a(n) = 0 if x^2 = 2 mod p has one solution (only for p = 2).
Comments