OFFSET
1,1
EXAMPLE
383 is ending prime for the following composites 182, 204, 218, 226, 228, 254, 329 and 341. For instance 341 (=11*31) -> 341 + (11+31) = 341 + 42 = 383.
MATHEMATICA
a[n_]:=NestWhile[#+Total[Times@@@FactorInteger[#]]&, n, !PrimeQ[#]&]; t={}; Do[If[!PrimeQ[n], AppendTo[t, a[n]]], {n, 4, nn=522}]; Select[Union[t], #<nn&] (* Jayanta Basu, Jun 01 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Sep 15 1999
STATUS
approved