# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a243151 Showing 1-1 of 1 %I A243151 #6 Jun 01 2014 00:08:30 %S A243151 1,11,36,34,99,258,391,163,341,951,867,1692,1114,793,4792,3019,1935, %T A243151 5469,6398,6152,8906,1987,15815,19603,16292,26216,32113,19718,24354, %U A243151 45903,15776,42202,34572,44411,46911,67972,39291,52299,30499,28383,38001,89782,95017,55954 %N A243151 Least number k not divisible by 10 such that the decimal expansion of k^n contains some digit exactly n times. %C A243151 If k were divisible by 10, all of those numbers would work for any n and the sequence would be 1, 10, 10, 10, 10, 10, 10, 10, .... %C A243151 Does a(n) exist for each n? - _Charles R Greathouse IV_, May 31 2014 %F A243151 a(n) > 10 for all n > 1. (Proof: check up to 21, then note that 9^22 < 10^21.) _Charles R Greathouse IV_, May 31 2014 %e A243151 1^2, 2^2, 3^2, 4^2, ... 9^2 all have different digits. 11^2 = 121 has two of the same digit. So a(2) = 11. %o A243151 (Python) %o A243151 def c(n): %o A243151 ..for k in range(10**5): %o A243151 ....if k%10 !=0: %o A243151 ......count = 0 %o A243151 ......for i in range(10): %o A243151 ........if str(k**n).count(str(i)) == n: %o A243151 ..........return k %o A243151 n = 1 %o A243151 while n < 100: %o A243151 ..print(c(n)) %o A243151 ..n+=1 %o A243151 (PARI) digitct(n)=my(d=digits(n)); vector(10,i,sum(j=1,#d,d[j]==i-1)) %o A243151 a(n)=if(n==1,return(1)); my(k=9); until(k++%10 && #select(i->i==n, digitct(k^n)), ); k \\ _Charles R Greathouse IV_, May 31 2014 %K A243151 nonn,base %O A243151 1,2 %A A243151 _Derek Orr_, May 31 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE