
EXAMPLE

For n=3, initial prime=23, set {23, 29, 47} because 23 > 23+2*3=29 > 29+2*9=47.
For n=2 to 9, the sets are:
23, 29;
23, 29, 47;
239, 293, 347, 431;
239, 293, 347, 431, 443;
239, 293, 347, 431, 443, 491;
3413, 3449, 3881, 4073, 4157, 4297, 4801;
14249, 14537, 14957, 16217, 16301, 16319, 16481, 16673;
524219, 524939, 534659, 550859, 559859, 640859, 649499, 719483, 725531;


PROG

(PARI) checkp(p, n) = {ok = isprime(p); for (i=1, n, print1(p, ", "); digs = digits(p); np = p + prod(i=1, #digs, if (d=digs[i], d, 1)); p = np; if (i != n, ok = ok && isprime(p)); ); ok; } \\ Michel Marcus, Dec 15 2013
