

A037273


Number of steps to reach a prime under "replace n with concatenation of its prime factors", or 1 if no such number.


30



1, 0, 0, 2, 0, 1, 0, 13, 2, 4, 0, 1, 0, 5, 4, 4, 0, 1, 0, 15, 1, 1, 0, 2, 3, 4, 4, 1, 0, 2, 0, 2, 1, 5, 3, 2, 0, 2, 1, 9, 0, 2, 0, 9, 6, 1, 0, 15
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,4


LINKS

Table of n, a(n) for n=1..48.
P. De Geest, Home Primes
Eric Weisstein's World of Mathematics, Home Prime


EXAMPLE

13 is already prime, so a(13) = 0.
Starting with 14 we get 14 = 2*7, 27 = 3*3*3, 333 = 3*3*37, 3337 = 47*71, 4771 = 13*367, 13367 is prime; so a(14) = 5.


MATHEMATICA

nxt[n_] := FromDigits[Flatten[IntegerDigits/@Table[#[[1]], {#[[2]]}]&/@ FactorInteger[n]]]; Table[Length[NestWhileList[nxt, n, !PrimeQ[#]&]]  1, {n, 48}] (* Harvey P. Dale, Jan 03 2013 *)


PROG

(Haskell)
a037273 1 = 1
a037273 n = length $ takeWhile ((== 0) . a010051) $
iterate (\x > read $ concatMap show $ a027746_row x :: Integer) n
 Reinhard Zumkeller, Jan 08 2013


CROSSREFS

Cf. A037271A037275, A056938.
Cf. A010051, A027746.
Sequence in context: A049218 A212358 A154469 * A285313 A231366 A158924
Adjacent sequences: A037270 A037271 A037272 * A037274 A037275 A037276


KEYWORD

sign,nice,hard,base


AUTHOR

N. J. A. Sloane, Jeff Burch


EXTENSIONS

Starting with 49, no prime has been reached after 79 steps.
Edited by Charles R Greathouse IV, Apr 23 2010
a(1) = 1 by Reinhard Zumkeller, Jan 08 2013


STATUS

approved



