%I #16 Jun 30 2022 12:46:13
%S 1,6,11,24,30,38,33,28,55,57,53,56,84,109,86,124,145,118,126,159,134,
%T 164,161,197,155,212,246,217,222,250,249,248,294,300,293,328,274,295,
%U 298,287,289,404,385,354,361,366,412,407,359,438,417
%N Smallest k such that 9^k has exactly n 3's in its decimal representation.
%C What is the least n such that a(n) does not exist? Heuristics suggest around a(50000). - _Charles R Greathouse IV_, Dec 29 2014
%C The least n's such that a(n) does not exist appear to be 25337 and 89200, based on the computation of 9^k < 10^1450000. - _Giovanni Resta_, Jun 27 2018
%H Charles R Greathouse IV, <a href="/A063629/b063629.txt">Table of n, a(n) for n = 0..10000</a>
%t a = {}; Do[k = 1; While[ Count[ IntegerDigits[9^k], 3] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
%t Module[{nn=50,k=9^Range[500]},Table[Position[k,_?(DigitCount[#,10,3]==n&),1,1],{n,0,nn}]]//Flatten (* _Harvey P. Dale_, Jun 30 2022 *)
%o (PARI) a(n)=my(k,d); while(1, d=digits(9^k); if(sum(i=1,#d,d[i]==3)==n, return(k)); k++) \\ _Charles R Greathouse IV_, Dec 29 2014
%K base,nonn
%O 0,2
%A _Robert G. Wilson v_, Aug 10 2001
|