login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285451 Least number x such that x^n has n digits equal to k. Case k=4. 3

%I #13 May 06 2017 09:23:06

%S 4,12,114,261,384,258,896,1491,1739,2768,3241,3974,1114,4522,9368,

%T 5144,1935,11982,8461,19038,13692,25173,16484,37477,21003,26216,46587,

%U 42619,29054,74082,41952,42202,89028,55008,89509,94607,152995,117981,137012,157011,95466

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

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

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

%t With[{k = 4}, Table[x = 1; While[DigitCount[x^n, 10, k] != n, x++]; x, {n, 41}]] (* _Michael De Vlieger_, May 01 2017 *)

%o (PARI) A285451vec=(n, {k=4})->{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))} \\ _R. J. Cano_, Apr 30 2017

%K nonn,base,easy

%O 1,1

%A _Paolo P. Lava_, Apr 19 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 02:46 EDT 2024. Contains 371917 sequences. (Running on oeis4.)