cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A090493 Least k such that n^k contains all the digits from 0 through 9, or 0 if no such k exists.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Dec 03 2003

Keywords

Comments

Note that the values of n for which a(n) = 1 have density 1.
Is it known that a(n)=0 only for n a power of 10? - Christopher J. Smyth, Aug 21 2014
a(n) >= ceiling(log_n(10)*9), whenever a(n)>0. This is because in order for an integer to have 10 digits its base-10 magnitude must be at least 9. - Ely Golden, Sep 06 2017

Examples

			a(5)=19: 5^19 = 19073486328125.
		

Crossrefs

Exponents of powers of k that contain all ten decimal digits: A130694 (k=2), A236673 (k=3), A284670 (k=5), A284672 (k=7).

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