OFFSET
1,1
COMMENTS
Unlike similar sequences, this sequence does not terminate when a prime is reached; the next term after a prime p is 10*p+1.
EXAMPLE
The factorization of a(2) = 21 is 3^1 * 7^1, so we concatenate 3,1,7,1 to get a(3) = 3171.
MATHEMATICA
NestList[FromDigits[Flatten[IntegerDigits/@FactorInteger[#]]]&, 2, 10] (* Harvey P. Dale, Oct 16 2014 *)
PROG
(PARI) catnum(n, m, b=10)=local(p=1); while(p<=m, p*=b); n*p+m
anext(n, b=10)=local(fm, r); fm=factor(n); for(k=1, matsize(fm)[1], r=catnum(r, catnum(fm[k, 1], fm[k, 2], b), b)); r
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Franklin T. Adams-Watters, Sep 14 2011
STATUS
approved