login
Numbers k such that sigma(k) - k - 2 is prime.
1

%I #23 Dec 04 2020 09:22:13

%S 8,9,15,16,18,27,32,33,35,36,45,50,51,64,65,75,77,87,91,95,98,119,123,

%T 125,135,143,144,147,153,161,162,175,177,185,195,200,207,209,213,215,

%U 217,221,231,247,259,261,273,285,287,297,303,315,321

%N Numbers k such that sigma(k) - k - 2 is prime.

%C Maple and Mathematica programs adapted from A085842.

%H Amiram Eldar, <a href="/A306490/b306490.txt">Table of n, a(n) for n = 1..10000</a>

%e The divisors of 8 are {1, 2, 4, 8}. sigma(8) - 8 - 2 = 5, which is prime.

%p with(numtheory): b := []: for n from 3 to 2000 do t1 := divisors(n); t2 := convert(t1, list); t3 := add(t2[i], i=1..nops(t2)); if isprime(t3-2-n) then b := [op(b), n]; fi; od: b;

%t f[n_]:=Plus@@Divisors[n]-n-2; lst={}; Do[a=f[n]; If[PrimeQ[a], AppendTo[lst, n]], {n, 7!}]; lst

%t Select[Range[2, 500], PrimeQ[DivisorSigma[1, #] - # - 2] &] (* _Vaclav Kotesovec_, Feb 23 2019 *)

%o (PARI) isok(n) = isprime(sigma(n) - n - 2); \\ _Michel Marcus_, Feb 23 2019

%o (GAP) Filtered([2..330],k->IsPrime(Sigma(k)-k-2)); # _Muniru A Asiru_, Feb 24 2019

%Y Cf. A085842, A037020, A000203.

%K nonn,easy

%O 1,1

%A _Jan Koornstra_, Feb 19 2019