OFFSET
1,1
MATHEMATICA
f[ n_Integer ] := Block[ {k = n + PrimePi[ n ] + 1}, While[ k - PrimePi[ k ] - 1 != n, k++ ]; k ]; s = 0; Do[ s = s + f[ n ]; If[ PrimeQ[ n ] && PrimeQ[ s ], Print[ n ] ], {n, 1, 5000} ]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Mar 22 2001
STATUS
approved