login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest k such that 9^k has exactly n 9's in its decimal representation.
0

%I #8 Jan 06 2023 15:48:36

%S 2,1,5,15,25,18,41,56,51,69,66,102,87,137,88,116,100,117,135,151,129,

%T 110,190,139,187,210,236,253,218,261,264,257,301,318,312,303,285,335,

%U 291,337,300,310,384,351,390,362,374,405,413,435,436

%N Smallest k such that 9^k has exactly n 9's in its decimal representation.

%t a = {}; Do[k = 1; While[ Count[ IntegerDigits[9^k], 9] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a

%t Module[{nn=500,tbl},tbl=Table[{n,DigitCount[9^n,10,9]},{n,nn}];Table[SelectFirst[ tbl,#[[2]] == k&],{k,0,50}]][[All,1]] (* _Harvey P. Dale_, Jan 06 2023 *)

%K base,nonn

%O 0,1

%A _Robert G. Wilson v_, Aug 10 2001

%E Name corrected by _Jon E. Schoenfield_, Jun 26 2018