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

%I #21 Apr 29 2017 22:12:53

%S 3,56,179,34,202,536,607,1182,1236,3875,3076,2142,4574,5378,9347,

%T 14524,2013,8403,13037,9534,20939,1987,28882,27146,16292,34546,48493,

%U 85926,52953,48318,64558,116514,49665,90279,46911,117256,61286,139083,120265,199582,170357

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

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

%e a(4) = 34 because 34^4 = 1336336 has 4 digits '3' 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,3);

%o (PARI) a(n, k=3) = {my(j=1); while(#select(x->x==k, digits(j^n)) != n, j++); j;} \\ _Michel Marcus_, Apr 29 2017

%o (PARI) A285450vec=(n, {k=3})->{my(L:list, c); L=List(); for(t=1, n, forstep(y=1, +oo, 1, c=digits(y^t); if(sum(j=1, #c, c[j]==k)==t, listput(L, y); break()))); return(Vec(L))} \\ Returns a vector containing the first n terms. - _R. J. Cano_, Apr 29 2017

%Y Cf. A285448, A285449, A285451, A285452, A285453, A285454, A285455, A285456.

%K nonn,base,easy

%O 1,1

%A _Paolo P. Lava_, Apr 19 2017