f:= proc(p) local q; option remember;
if isprime(p) and isprime(p + 4*(p mod 3)  6) then
1 + procname(3*p+2)
else 0
fi
end proc:
f(3):= 2:
A:= Vector(4): count:= 0:
for p from 5 by 2 while count < 4 do
v:= f(p);
if v > 0 and A[v] = 0 then A[v]:= p; fi
od:
convert(A, list);
