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.

This page as a plain text file.
%I A257002 #22 Sep 08 2022 08:46:12
%S A257002 7,13,19,31,37,61,67,109,127,139,157,181,193,199,211,307,313,337,379,
%T A257002 397,409,487,499,541,571,577,631,691,751,769,787,811,829,877,919,937,
%U A257002 991,1009,1021,1039,1117,1201,1291,1297,1327,1381,1399,1459,1471,1531,1567
%N A257002 Primes p such that p+2 divides p^p+2.
%C A257002 All the terms in this sequence are congruent to 1 mod 3.
%C A257002 Primes p such that 2^p == 2 (mod p+2). Includes A091180. - _Robert Israel_, Apr 14 2015
%H A257002 K. D. Bajpai, <a href="/A257002/b257002.txt">Table of n, a(n) for n = 1..5700</a>
%e A257002 a(1) = 7 is prime; 7+2 = 9 divides 7^7 + 2 = 823545.
%e A257002 a(2) = 13 is prime; 13+2 = 15 divides 13^13 + 2 = 302875106592255.
%p A257002 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
%t A257002 Select[Prime[Range[3000]], Mod[#^# + 2, # + 2] == 0 &]
%t A257002 Select[Prime[Range[500]],PowerMod[#,#,#+2]==#&] (* _Harvey P. Dale_, May 19 2017 *)
%o A257002 (PARI) forprime(p=2,1000, if(Mod(p^p+2,p+2)==0, print1(p, ", ")));
%o A257002 (Python)
%o A257002 from sympy import prime
%o A257002 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
%o A257002 (Magma) [ p: p in PrimesUpTo(1600) | (p^p+2) mod (p+2) eq 0 ]; // _Vincenzo Librandi_, Apr 15 2015
%Y A257002 Cf. A000040, A091180, A213382.
%K A257002 nonn
%O A257002 1,1
%A A257002 _K. D. Bajpai_, Apr 14 2015