A090493 Least k such that n^k contains all the digits from 0 through 9, or 0 if no such k exists.
0, 68, 39, 34, 19, 20, 18, 28, 24, 0, 23, 22, 22, 21, 12, 17, 14, 21, 17, 51, 17, 18, 14, 19, 11, 18, 13, 11, 12, 39, 11, 14, 16, 14, 19, 10, 13, 14, 17, 34, 11, 17, 13, 16, 15, 11, 12, 12, 9, 18, 16, 11, 13, 10, 12, 7, 13, 11, 11, 20, 14, 18, 13, 14, 10, 13, 10, 9, 11, 18, 15
Offset: 1
Examples
a(5)=19: 5^19 = 19073486328125.
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
- Ely Golden, Python program to generate a(n)
Crossrefs
Programs
-
Maple
a:= proc(n) local k; if n = 10^ilog10(n) then return 0 fi; for k from 1 do if nops(convert(convert(n^k,base,10),set))=10 then return k fi od end proc: seq(a(n),n=1..100); # Robert Israel, Aug 20 2014
-
Mathematica
Table[If[IntegerQ@ Log10[n], 0, SelectFirst[Range[#, # + 100] &@ Ceiling[9 Log[n, 10]], NoneTrue[DigitCount[n^#], # == 0 &] &]], {n, 71}] (* Michael De Vlieger, Sep 06 2017 *)
-
PARI
a(n) = if (n == 10^valuation(n, 10), return (0)); k=1; while(#vecsort(digits(n^k),,8)!=10, k++); k; \\ Michel Marcus, Aug 20 2014
-
Python
def a(n): s = str(n) if n == 1 or (s.count('0')==len(s)-1 and s.startswith('1')): return 0 k = 1 count = 0 while count != 10: count = 0 for i in range(10): if str(n**k).count(str(i)) == 0: count += 1 break if count: k += 1 else: return k n = 1 while n < 100: print(a(n), end=', ') n += 1 # Derek Orr, Aug 20 2014
Formula
a(10^e) = 0; a(m^e) = a(m)/e for e dividing a(m). - Reinhard Zumkeller, Dec 06 2004
Extensions
More terms from Reinhard Zumkeller, Dec 06 2004
Corrected a(15), a(17), a(38), a(48), a(56) and a(65). (For each of these terms, the only 1 in n^k is the first digit.) - Jon E. Schoenfield, Sep 20 2008
Comments