A050252 Number of digits in the prime factorization of n (counting terms of the form p^1 as p).
1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3, 3, 2, 4, 2, 3, 3, 3, 2, 3, 2, 4, 3, 3, 2, 3, 2, 3, 3, 4, 2, 3, 3, 3, 3, 3, 2, 4, 2, 3, 3, 2, 3, 4, 2, 4, 3, 3, 2, 4, 2, 3, 3, 4, 3, 4, 2, 3, 2, 3, 2, 4, 3, 3, 3, 4, 2, 4, 3, 4, 3, 3, 3, 3, 2, 3, 4, 4, 3, 4
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Prime Factorization.
Crossrefs
Programs
-
Haskell
a050252 1 = 1 a050252 n = sum $ map a055642 $ (a027748_row n) ++ (filter (> 1) $ a124010_row n) -- Reinhard Zumkeller, Aug 03 2013, Jun 21 2011
-
Mathematica
nd[n_]:=Total@IntegerLength@Select[Flatten@FactorInteger[n],#>1&];Table[If[n==1,1,nd[n]],{n,102}] (* Vladimir Joseph Stephan Orlovsky, Jan 30 2012 *)
-
Python
from sympy import factorint def a(n): return 1 if n == 1 else sum(len(str(p))+(len(str(e)) if e>1 else 0) for p, e in factorint(n).items()) print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Dec 27 2024