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.

A309007 Largest k such that n^k has distinct digits in base 10 (for n>1).

This page as a plain text file.
%I A309007 #28 Jul 09 2019 21:32:45
%S A309007 29,9,10,8,4,8,5,3,1,0,4,4,5,1,5,6,4,3,1,3,3,4,3,4,1,3,2,3,1,2,4,2,1,
%T A309007 3,2,2,5,1,1,3,2,2,4,1,1,1,4,4,1,2,2,2,2,2,1,2,1,3,1,2,1,1,2,1,3,1,1,
%U A309007 3,1,2,2,3,2,3,3,0,2,2,1,1,2,1,3,1,2,2
%N A309007 Largest k such that n^k has distinct digits in base 10 (for n>1).
%F A309007 a(n) = 0 for any n > 9876543210. - _Rémy Sigrist_, Jul 06 2019
%e A309007 For n = 2, 2^29 = 536870912, which is the largest power of 2 to contain distinct digits.
%t A309007 a[n_] := SelectFirst[ Range[ Floor@ Log[n, 10^10], 0, -1], (Sort[#] == Union[#]) &@ IntegerDigits[ n^#] &]; Array[a, 86, 2] (* _Giovanni Resta_, Jul 07 2019 *)
%o A309007 (Python)
%o A309007 def distinct_digits(n):
%o A309007     p = math.floor(math.log(10**10)/math.log(n))
%o A309007     while p >= 1:
%o A309007         d = n**p
%o A309007         if len(set(str(d))) == len(str(d)):
%o A309007             return(p)
%o A309007         else:
%o A309007             p = p - 1
%o A309007     return(0)
%o A309007 (PARI) a(n) = forstep (k=logint(10^10, n), 0, -1, my (d=digits(n^k)); if (#d==#Set(d), return (k))) \\ _Rémy Sigrist_, Jul 06 2019
%Y A309007 Cf. A010784.
%Y A309007 For n=2, see A084688 and A260814.
%K A309007 nonn,base
%O A309007 2,1
%A A309007 _Tom Bryan_, Jul 05 2019
%E A309007 More terms from _Rémy Sigrist_, Jul 06 2019