login
Smallest Niven (or Harshad) number (A005349) with exactly n distinct prime factors.
3

%I #32 Jan 22 2023 08:44:45

%S 1,2,6,30,210,2310,30030,690690,14804790,223092870,8254436190,

%T 200560490130,8222980095330,304250263527210,13082761331670030,

%U 614889782588491410,32589158477190044730,1987938667108592728530,117288381359406970983270,7858321551080267055879090

%N Smallest Niven (or Harshad) number (A005349) with exactly n distinct prime factors.

%C a(11) = 200560490130; a(13) = 304250263527210.

%C a(n) >= A002110(n) = prime(n)#.

%C Many terms are primorial numbers, see A360011.

%H Giovanni Resta, <a href="https://www.numbersaplenty.com/set/Harshad_number/">Harshad numbers</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DistinctPrimeFactors.html">Distinct Prime Factors</a>.

%e 2310 = 2*3*5*7*11 is the smallest integer with 5 prime factors because it is a primorial number, as 2310 / (2+3+1+0) = 385, 2310 is a Niven number: a(5) = 2310.

%o (PARI) a(n) = my(k=1); while ((k % sumdigits(k)) || (omega(k) != n), k++); k; \\ _Michel Marcus_, Jan 20 2023

%o (PARI)

%o omega_niven(A, B, n) = A=max(A, vecprod(primes(n))); (f(m, p, j) = my(list=List()); forprime(q=p, sqrtnint(B\m, j), my(v=m*q, r=nextprime(q+1)); while(v <= B, if(j==1, if(v>=A && v%sumdigits(v) == 0, listput(list, v)), if(v*r <= B, list=concat(list, f(v, r, j-1)))); v *= q)); list); vecsort(Vec(f(1, 2, n)));

%o a(n) = if(n==0, return(1)); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=omega_niven(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ _Daniel Suteu_, Jan 22 2023

%Y Cf. A001221, A002110, A005349, A113315, A360011.

%Y Similar: A060319 (Fibonacci), A083002 (oblong), A359961 (Zuckerman).

%K nonn,base

%O 0,2

%A _Bernard Schott_, Jan 20 2023

%E a(8)-a(9) from _Michel Marcus_, Jan 20 2023

%E a(10)-a(19) from _Daniel Suteu_, Jan 22 2023