OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=46, sigma(46)=1+2+23+46=72, for n=51, sigma(51)=1+3+17+51=72 and also for n=55, sigma(55)=1+5+11+55=72 is the middle term of {71,73} twins.
MATHEMATICA
Do[s=-1+DivisorSigma[1, n]; s1=1+DivisorSigma[1, n]; If[PrimeQ[s]&&PrimeQ[s1]&&!PrimeQ[n], Print[n]], {n, 1, 2000}]
cntpQ[n_]:=Module[{ds=DivisorSigma[1, n]}, CompositeQ[n]&&AllTrue[ds+{1, -1}, PrimeQ]]; Select[Range[500], cntpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 05 2015 *)
PROG
(PARI) isok(n) = my(s=sigma(n)); !isprime(n) && isprime(s-1) && isprime(s+1); \\ Michel Marcus, Apr 24 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Feb 08 2002
STATUS
approved