A265425 Numbers n such that n+2 and sigma(n-1) are both primes.
3, 5, 17, 65, 4097, 65537, 262145, 1073741825
Offset: 1
Examples
Number 17 is in the sequence because 17 + 2 = 19 and sigma(17-1) = sigma(16) = 31; 17 and 31 are primes.
Programs
-
Magma
[n: n in [2..1000000] | IsPrime(n+2) and IsPrime(SumOfDivisors(n-1))]
-
Mathematica
Select[Range[10^7], And[PrimeQ[# + 2], PrimeQ[DivisorSigma[1, # - 1]]] &] (* Michael De Vlieger, Dec 09 2015 *)
-
PARI
for(n=2, 10^7, if(ispseudoprime(n+2) && ispseudoprime(sigma(n-1)), print1(n, ", "))) \\ Altug Alkan, Dec 08 2015
Comments