Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #26 Aug 01 2024 18:08:17
%S 2,7,23,727,2399,5039,7919,17159,28559,29927,85847,458327,552047,
%T 579119,707279,1190279,3418799,3728759,4532639,5166527,5331479,
%U 7447439,10374839,24137567,25877567,28398239,30260999,43546799,47458319,52258439,56957207,62425799
%N Primes p such that sum of divisors of p+2 is prime.
%C If p is a term then p+2 is a prime power with an even exponent (A056798). - _Amiram Eldar_, Aug 01 2024
%H Amiram Eldar, <a href="/A171130/b171130.txt">Table of n, a(n) for n = 1..10000</a>
%e 2 is a term since it is a prime and sigma(2+2) = 7 is a prime.
%e 7 is a term since it is a prime and sigma(7+2) = 13 is a prime.
%e 23 is a term since it is a prime and sigma(23+2) = 31 is a prime.
%e 727 is a term since it is a prime and sigma(727+2) = 1093 is a prime.
%p with(numtheory): A171130:=n->`if`(isprime(n) and isprime(sigma(n+2)), n, NULL): seq(A171130(n), n=1..10^5); # _Wesley Ivan Hurt_, Sep 30 2014
%t f[n_]:=Plus@@Divisors[n]; lst={};Do[p=Prime[n];If[PrimeQ[f[p+2]],AppendTo[lst,p]],{n,10!}];lst
%t Select[Prime[Range[700000]],PrimeQ[DivisorSigma[1,#+2]]&] (* _Harvey P. Dale_, Jun 23 2011 *)
%o (PARI) lista(nn) = forprime(p=2, nn, if (isprime(sigma(p+2)), print1(p, ", "))); \\ _Michel Marcus_, Sep 30 2014
%o (PARI) lista(kmax) = {my(p); for(k = 1, kmax, if(isprime(k) || isprimepower(k), p = k^2-2; if(isprime(p) && isprime(sigma(p+2)), print1(p, ", "))));} \\ _Amiram Eldar_, Aug 01 2024
%Y Cf. A000203, A056798.
%K nonn
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Dec 04 2009
%E More terms from _Michel Marcus_, Sep 30 2014