A038703 Primes p such that p^2 mod q is odd, where q is the previous prime.
3, 5, 17, 29, 37, 127
Offset: 1
Examples
The first prime with a prime lower than itself is 3. This squared is 9, which when divided by the previous prime 2 leaves remainder 1, which is odd. So 3 is in the sequence. 11 is not in the sequence because 11^2, when divided by the previous prime 7, leaves a remainder of 121 (mod 7) = 2, which is even.
Links
- Eric Weisstein's World of Mathematics, Prime Gaps
Programs
-
Mathematica
Prime /@ Select[ Range[ 2, 100 ], OddQ[ Mod[ Prime[ # ]^2, Prime[ # - 1 ] ] ] & ] Transpose[Select[Partition[Prime[Range[50]],2,1],OddQ[PowerMod[Last[#],2, First[#]]]&]] [[2]] (* Harvey P. Dale, May 31 2012 *)
-
PARI
isok(p) = isprime(p) && (p>2) && (lift(Mod(p, precprime(p-1))^2) % 2); \\ Michel Marcus, Mar 05 2023
Formula
Prime(k) is in the sequence if prime(k)^2 (mod prime(k-1)) is odd.
Extensions
More terms from Olivier Gérard, Jun 26 2001
Comments