login
a(n) is the largest n-digit number with exactly 8 divisors, a(n) = 0 if no such number exists.
2

%I #25 Apr 09 2024 05:20:20

%S 0,88,999,9994,99995,999994,9999994,99999994,999999998,9999999995,

%T 99999999998,999999999998,9999999999998,99999999999998,

%U 999999999999995,9999999999999998,99999999999999998,999999999999999987,9999999999999999995,99999999999999999985,999999999999999999995

%N a(n) is the largest n-digit number with exactly 8 divisors, a(n) = 0 if no such number exists.

%C a(n) is the largest n-digit number of the form p^7, p^3*q or p*q*r (p, q, r = distinct primes), a(n) = 0 if no such number exists.

%H Amiram Eldar, <a href="/A182676/b182676.txt">Table of n, a(n) for n = 1..100</a>

%F a(n) = max {10^(n-1) <= k < 10^n : A000005(k)=8} if set is nonempty, else a(n) = 0.

%p with(numtheory):

%p a:= proc(n) local k;

%p if n<2 then 0

%p else for k from 10^n-1 while tau(k)<>8 by -1

%p do od; k

%p fi

%p end:

%p seq(a(n), n=1..20);

%o (PARI) a(n)=forstep(k=10^n-1,10^(n-1),-1,numdiv(k)==8 & return(k)) \\ _M. F. Hasler_, Nov 27 2010

%Y Cf. A000005, A030626, A182675.

%K nonn,base

%O 1,2

%A _Jaroslav Krizek_, Nov 27 2010

%E Edited by _Alois P. Heinz_, Nov 27 2010

%E Given terms double-checked with given PARI code by _M. F. Hasler_, Nov 27 2010

%E a(20)-a(21) from _Amiram Eldar_, Apr 09 2024