%I #8 Mar 18 2023 11:37:52
%S 1,18,21,32,30,38,33,55,69
%N Least number k such that n^k contains the digit n n times.
%e 2^18 is the first power of 2 to contain 2 twice. So a(2) = 18.
%e 3^21 is the first power of 3 to contain 3 three times. So a(3) = 21.
%o (Python)
%o def tes(n):
%o for k in range(1,10**3):
%o if(str(n**k).count(str(n))) == n:
%o return k
%o n = 1
%o while n < 10:
%o print(tes(n),end=', ')
%o n += 1
%K nonn,base,fini,full
%O 1,2
%A _Derek Orr_, Jul 01 2014
|