login

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”).

Smallest k such that 5^k has exactly n 2's in its decimal representation.
1

%I #10 Aug 02 2019 08:41:00

%S 1,2,11,13,28,25,46,53,64,66,85,100,97,115,116,148,145,107,139,184,

%T 175,209,199,274,276,251,232,244,342,250,329,339,312,375,354,332,394,

%U 351,419,362,453,415,484,517,509,468,550,541,496,522,504

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

%H Robert Israel, <a href="/A063587/b063587.txt">Table of n, a(n) for n = 0..5000</a>

%p N:= 100:

%p V:= Array(0..N): count:= 0:

%p for k from 1 while count < N+1 do

%p v:= numboccur(2, convert(5^k,base,10));

%p if v <= N and V[v] = 0 then count:= count+1; V[v]:= k;

%p fi

%p od:

%p seq(V[i],i=0..N); # _Robert Israel_, Aug 02 2019

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

%K base,nonn

%O 0,2

%A _Robert G. Wilson v_, Aug 10 2001

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