Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Jan 21 2023 12:44:39
%S 1,4,9,25,36,54,45,56,68,106,87,98,100,203,140,154,160,174,165,263,
%T 246,243,157,234,276,280,338,308,343,371,335,299,427,394,497,475,473,
%U 405,524,467,577,485,586,509,492,644,464,677,563,616,582
%N Smallest k such that 4^k has exactly n 2's in its decimal representation.
%t a = {}; Do[k = 1; While[ Count[ IntegerDigits[4^k], 2] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
%t With[{nk2=Table[{k,DigitCount[4^k,10,2]},{k,700}]},Table[SelectFirst[nk2,#[[2]] == n&],{n,0,50}]][[All,1]] (* _Harvey P. Dale_, Jan 21 2023 *)
%K base,nonn
%O 0,2
%A _Robert G. Wilson v_, Aug 10 2001
%E Name corrected by _Jon E. Schoenfield_, Jun 26 2018