cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A037273 Number of steps to reach a prime under "replace n with concatenation of its prime factors", or -1 if no prime is ever reached.

This page as a plain text file.
%I A037273 #41 Feb 16 2025 08:32:37
%S A037273 -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,
%T A037273 5,3,2,0,2,1,9,0,2,0,9,6,1,0,15
%N A037273 Number of steps to reach a prime under "replace n with concatenation of its prime factors", or -1 if no prime is ever reached.
%C A037273 Starting with 49, no prime has been reached after 79 steps.
%C A037273 a(49) > 118, see A056938 and FactorDB link. - _Michael S. Branicky_, Nov 19 2020
%H A037273 Patrick De Geest, <a href="http://www.worldofnumbers.com/topic1.htm">Home Primes</a>
%H A037273 FactorDB, <a href="http://factordb.com/sequences.php?se=10&amp;aq=49&amp;action=all&amp;fr=0&amp;to=100">Home prime base 10</a>
%H A037273 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HomePrime.html">Home Prime</a>
%e A037273 13 is already prime, so a(13) = 0.
%e A037273 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.
%t A037273 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 *)
%o A037273 (Haskell)
%o A037273 a037273 1 = -1
%o A037273 a037273 n = length $ takeWhile ((== 0) . a010051) $
%o A037273    iterate (\x -> read $ concatMap show $ a027746_row x :: Integer) n
%o A037273 -- _Reinhard Zumkeller_, Jan 08 2013
%o A037273 (PARI) row_a027746(n, o=[1])=if(n>1, concat(apply(t->vector(t[2], i, t[1]), Vec(factor(n)~))), o) \\ after _M. F. Hasler_ in A027746
%o A037273 tonum(vec) = my(s=""); for(k=1, #vec, s=concat(s, Str(vec[k]))); eval(s)
%o A037273 a(n) = if(n==1, return(-1)); my(x=n, i=0); while(1, if(ispseudoprime(x), return(i)); x=tonum(row_a027746(x)); i++) \\ _Felix Fröhlich_, May 17 2021
%o A037273 (Python)
%o A037273 from sympy import factorint
%o A037273 def a(n):
%o A037273     if n < 2: return -1
%o A037273     klst, f = [n], sorted(factorint(n, multiple=True))
%o A037273     while len(f) > 1:
%o A037273         klst.append(int("".join(map(str, f))))
%o A037273         f = sorted(factorint(klst[-1], multiple=True))
%o A037273     return len(klst) - 1
%o A037273 print([a(n) for n in range(1, 49)]) # _Michael S. Branicky_, Aug 02 2021
%Y A037273 Cf. A037271, A037272, A037274, A037275, A056938.
%Y A037273 Cf. A010051, A027746.
%K A037273 sign,nice,hard,base,more
%O A037273 1,4
%A A037273 _N. J. A. Sloane_, _Jeff Burch_
%E A037273 Edited by _Charles R Greathouse IV_, Apr 23 2010
%E A037273 a(1) = -1 by _Reinhard Zumkeller_, Jan 08 2013
%E A037273 Name edited by _Felix Fröhlich_, May 17 2021