%I #9 Apr 23 2016 09:15:51
%S 5,9,15,39,72,128,228,309,417,562,567,657,740,762,779,789,927,959,967,
%T 981,1214,1315,1364,1632,1650,1667,1785,1825,2295,2425,2442,2607,2709,
%U 2721,2840,3085,3114,3194,3401,3812,3911,4428,4472,4479,4645,4753,4780
%N Indices of double-safe primes: p=prime(n) is double-safe: q=(p-1)/2 & r=(q-1)/2 are both prime (and q is safe).
%C prime p is safe if q=(p-1)/2 is prime, so p is double safe if also r=(q-1)/2 is prime. Safe primes are in A005385, indices of triple-safe primes are in A075314
%e 72 is a member because p(72)=359, q=(p-1)/2=179 and r=(q-1)2=89 are primes.
%t se2=Select[(Select[(Prime[Range[20000]]-1)/2, PrimeQ]-1)/2, PrimeQ]; Map[PrimePi, Map[2(2*#+1)+1&, se2]]
%t dspQ[n_]:=Module[{q=(n-1)/2},AllTrue[{q,(q-1)/2},PrimeQ]]; Position[ Prime[ Range[5000]],_?(dspQ[#]&)]//Flatten (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Apr 23 2016 *)
%Y Cf. A005385, A075314.
%K nonn
%O 1,1
%A _Zak Seidov_, Sep 04 2002