login
Least number k > 0 such that 2^k contains exactly n different digits.
0

%I #8 Jan 22 2023 13:22:28

%S 1,4,7,10,14,21,20,37,29,68

%N Least number k > 0 such that 2^k contains exactly n different digits.

%e 2^7 = 128 is the first power of 2 with 3 different digits. Thus a(3) = 7.

%t dd[n_]:=Count[DigitCount[2^n],_?(#>0&)]; Table[SelectFirst[Table[{n,dd[n]},{n,70}], #[[2]] == k&],{k,10}][[All,1]] (* _Harvey P. Dale_, Jan 22 2023 *)

%o (PARI) a(n)=for(k=1,10^3,st=2^k;if(#digits(st)>=n,c=0;for(i=0,9,for(j=1,#digits(st),if(digits(st)[j]==i,c++;break)));if(c==n,return(k))))

%o n=1;while(n<11,print1(a(n),", ");n++)

%K nonn,base,full,fini

%O 1,2

%A _Derek Orr_, Jun 14 2014