cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257002 Primes p such that p+2 divides p^p+2.

Original entry on oeis.org

7, 13, 19, 31, 37, 61, 67, 109, 127, 139, 157, 181, 193, 199, 211, 307, 313, 337, 379, 397, 409, 487, 499, 541, 571, 577, 631, 691, 751, 769, 787, 811, 829, 877, 919, 937, 991, 1009, 1021, 1039, 1117, 1201, 1291, 1297, 1327, 1381, 1399, 1459, 1471, 1531, 1567
Offset: 1

Views

Author

K. D. Bajpai, Apr 14 2015

Keywords

Comments

All the terms in this sequence are congruent to 1 mod 3.
Primes p such that 2^p == 2 (mod p+2). Includes A091180. - Robert Israel, Apr 14 2015

Examples

			a(1) = 7 is prime; 7+2 = 9 divides 7^7 + 2 = 823545.
a(2) = 13 is prime; 13+2 = 15 divides 13^13 + 2 = 302875106592255.
		

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(1600) | (p^p+2) mod (p+2) eq 0 ]; // Vincenzo Librandi, Apr 15 2015
  • Maple
    select(t -> isprime(t) and (2 &^t - 2) mod (t+2) = 0, [seq(6*i+1,i=1..10^4)]); # Robert Israel, Apr 14 2015
  • Mathematica
    Select[Prime[Range[3000]], Mod[#^# + 2, # + 2] == 0 &]
    Select[Prime[Range[500]],PowerMod[#,#,#+2]==#&] (* Harvey P. Dale, May 19 2017 *)
  • PARI
    forprime(p=2,1000, if(Mod(p^p+2,p+2)==0, print1(p, ", ")));
    
  • Python
    from sympy import prime
    A257002_list = [p for p in (prime(n) for n in range(1,10**4)) if pow(p, p, p+2) == p] # Chai Wah Wu, Apr 14 2015