OFFSET
1,1
COMMENTS
Number of terms < 10^n: 0, 1, 26, 182, 1428, 10395, 84164, ... .
EXAMPLE
Only {21 & 37} -> 37, etc.
MATHEMATICA
lst = {}; f[n_] := FromDigits@ Flatten[ IntegerDigits@ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger@n, 2]; h[n_] := NestWhileList[f@# &, n, !PrimeQ@# &, 1, 28]; Do[p = h[n][[ -1]]; If[ PrimeQ@p && p < 10^7 && p != n, Print[{n, p}]; AppendTo[lst, p]], {n, 2, 1000}];
d = 2 - 2; lsu = {}; Do[ If[ lst[[n]] == lst[[n + d]] && lst[[n-1]] != lst[[n]] && lst[[n]] != lst[[n + d + 1]], AppendTo[lsu, lst[[n]]]], {n, 188004 - d - 1}]; Take[ Union@ lsu, 50]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Sep 30 2007
STATUS
approved