login
Least number x such that x^n has n digits equal to k. Case k = 7.
6

%I #19 Sep 13 2017 16:49:20

%S 7,76,83,118,206,959,1083,726,1387,1114,3313,4011,2184,3881,4792,

%T 13071,11564,15523,9208,15232,17771,46336,33815,39147,18083,27624,

%U 63435,77276,24354,92341,15776,67006,112877,54468,67996,109996,99376,154083,58937,148722,77335

%N Least number x such that x^n has n digits equal to k. Case k = 7.

%H Martin Gossow, <a href="/A285454/b285454.txt">Table of n, a(n) for n = 1..100</a>

%e a(4) = 118 because 118^4 = 193877776 has 4 digits '7' and is the least number to have this property.

%p P:=proc(q,h) local a,j,k,n,t; for n from 1 to q do for k from 1 to q do

%p a:=convert(k^n,base,10); t:=0; for j from 1 to nops(a) do if a[j]=h then t:=t+1; fi; od;

%p if t=n then print(k); break; fi; od; od; end: P(10^9,7);

%t f[n_] := Block[{k = 1}, While[ Count[ IntegerDigits[k^n], 7] != n, k++]; k]; Array[f, 41] (* _Robert G. Wilson v_, Apr 30 2017 *)

%Y Cf. A039938.

%K nonn,base,easy

%O 1,1

%A _Paolo P. Lava_, Apr 19 2017