login
Least number k > 1 such that k^n contains the digit k k times, or 0 if no such digit exists.
0

%I #4 Jul 01 2014 23:04:31

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,2,0,0,0,0,0,2,0,0,5,3,2,7,0,

%T 0,5,3,6,4,0,3,5,3,0,2,6,5,3,0,0,0,6,2,3,4,2,4,2,2,2,3,4,3,5,2,2,4,5,

%U 2,2,0,4,0,3,7,2,5,3,4,0,4,2,4,2,7,7,7,2,0,3,2,8,6,6,2,0,3,7,2,4,0,6,0,0,0,8,5,4,3,0,0,6,5,2,5,0,8,3

%N Least number k > 1 such that k^n contains the digit k k times, or 0 if no such digit exists.

%C 1 < a(n) < 10 if a(n) is not 0. Thus a(n) = 0 is definite for the n-values above.

%e 2^18, 2^19 and 2^21 all contain the digit 2 twice. So a(18) = a(19) = a(21) = 2.

%o (Python)

%o def tes(n):

%o ..for k in range(2,10):

%o ....if str(k**n).count(str(k)) == k:

%o ......return k

%o n = 1

%o while n < 200:

%o ..if tes(n):

%o ....print(tes(n),end=', ')

%o ..else:

%o ....print(0,end=', ')

%o ..n += 1

%Y Cf. A244604, A244603.

%K nonn,base,easy

%O 1,18

%A _Derek Orr_, Jul 01 2014