login
Numbers whose number of distinct prime factors equals the number of digits in the number.
4

%I #35 Apr 14 2023 02:27:40

%S 2,3,4,5,7,8,9,10,12,14,15,18,20,21,22,24,26,28,33,34,35,36,38,39,40,

%T 44,45,46,48,50,51,52,54,55,56,57,58,62,63,65,68,69,72,74,75,76,77,80,

%U 82,85,86,87,88,91,92,93,94,95,96,98,99,102,105,110,114,120,126,130,132

%N Numbers whose number of distinct prime factors equals the number of digits in the number.

%C Is this sequence finite? If the answer is yes, is there any estimate for the number of terms of this sequence? - _Parthasarathy Nambi_, Nov 16 2009

%C This sequence is finite since there are only finitely many primes less than 10. - _Charles R Greathouse IV_, Feb 04 2013

%C Specifically, all terms have <= 10 digits since primorial(k) = A002110(k) has > k digits for k > 10. - _Michael S. Branicky_, Apr 13 2023

%H Charles R Greathouse IV, <a href="/A165256/b165256.txt">Table of n, a(n) for n = 1..7812</a> (complete sequence)

%H Michael S. Branicky, <a href="/A165256/a165256.py.txt">Python program</a>

%e The number of distinct prime factors of 4 is 1, which is the same as the number of digits in 4, so 4 is in the sequence.

%e The number of distinct prime factors of 21 is 2, which is the same as the number of digits in 21, so 21 is in the sequence.

%e However, 25 is NOT in the sequence because the number of distinct prime factors of 25 is 1, which does not match the number of digits in 25.

%p omega := proc(n) nops(numtheory[factorset](n)) ; end: A055642 := proc(n) max(1, ilog10(n)+1) ; end: A165256 := proc(n) option remember; local a; if n = 1 then 2; else for a from procname(n-1)+1 do if A055642(a) = omega(a) then RETURN(a) ; fi; od: fi; end: seq(A165256(n),n=1..120) ; # _R. J. Mathar_, Sep 17 2009

%t Select[Range[200], IntegerLength[#] == Length[FactorInteger[#]] &] (* _Harvey P. Dale_, Mar 20 2011 *)

%o (PARI) is(n)=#Str(n)==omega(n) \\ _Charles R Greathouse IV_, Feb 04 2013

%o (Python) # see link for alternate version producing full sequence instantly

%o from sympy import primefactors

%o def ok(n): return len(primefactors(n)) == len(str(n))

%o print([k for k in range(10**5) if ok(k)]) # _Michael S. Branicky_, Apr 13 2023

%Y Cf. A001221, A055642, A115024, A002110.

%K base,nonn,fini,full

%O 1,1

%A _Parthasarathy Nambi_, Sep 11 2009

%E Extended by _R. J. Mathar_, Sep 17 2009