OFFSET
1,2
COMMENTS
The terms with 0 value listed above are conjectural. There are no primes < 10^30.
From Sean A. Irvine, Nov 09 2023: (Start)
None of the unresolved cases with n < 50 terminates in a prime < 10^130.
Because the trajectories under f can coalesce certain values are known to be equal even if that value is currently unknown. For example, a(1) = a(13) and a(9) = a(14).
Because of the inclusion of exponents 1 in the concatenation defined by f, terms in the trajectory typically grow quicker than in A195264 or A037274.
(End)
MATHEMATICA
(* f returns an array encoding the prime factorization of n *) f[ n_] := Module[ {a, l, i, t = {} }, a = FactorInteger[ n]; l = Length[ a]; For[ i = 1, i <= l, i++, t = Append[ t, a[ [ i]][ [ 1]]]; t = Append[ t, a[ [ i]][ [ 2]]]]; t];
(* g returns the concatenation of the elements of its input array *) g[ x_] := Module[ {r = "", m = Length[ x], l}, For[ l = 1, l <= m, l++, r = StringJoin[ r, ToString[ x[ [ l]]]]]; r];
(* h returns an array of the digits of its input int string *) h[ n_] := IntegerDigits[ ToExpression[ n]]
(* j returns the number formed from the digits in its input array *) j[ x_] := Module[ {r = 0, m = Length[ x], t = x, l}, For[ l = 1, l <= m, l++, r = 10*r + t[ [ 1]]; t = Rest[ t]]; r];
(* k composes the previous functions *) k[ n_] := j[ h[ g[ f[ n]]]]
s[ n_] := Module[ {a=n, r=0}, While[ !PrimeQ[ a] && a<10^30, a=k[ a]]; If[ PrimeQ[ a], r=a]; r]; Table[ s[ i], {i, 2, 50}]
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Joseph L. Pe, Feb 01 2002
EXTENSIONS
Offset changed to 1 by Jinyuan Wang, Jul 30 2020
a(7) and a(17) resolved and missing a(21) inserted by Sean A. Irvine, Nov 09 2023
STATUS
approved