login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355873
a(n) is the smallest positive exponent k such that the decimal expansion of n^k has at least one digit that occurs more than once.
0
16, 8, 8, 6, 5, 3, 6, 4, 2, 1, 2, 5, 3, 2, 4, 5, 5, 4, 2, 2, 1, 3, 4, 3, 2, 4, 3, 4, 2, 3, 5, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 1, 2, 2, 2, 3, 3, 2, 3, 3, 3, 3, 1, 2, 3, 2, 4, 2, 3, 2, 2, 3, 2, 1, 2, 2, 4, 2, 3, 3, 4, 3, 2, 2, 1, 3, 3, 2, 2, 3, 2, 4, 2, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 3, 2, 3, 1, 1, 1
OFFSET
2,1
FORMULA
a(n) = 1 for all n > 9876543210.
EXAMPLE
a(9) = 4 because 9^4 = 6561 has two digits 6 and 9^1 = 9, 9^2 = 81, 9^3 = 729, all with distinct digits.
PROG
(PARI) a(n) = my(d=digits(n), k=1); while(#d == #Set(d), k++; d=digits(n^k)); k; \\ Michel Marcus, Jul 20 2022
(Python)
def a(n):
k, sk = 1, str(n)
while len(set(sk)) == len(sk): k += 1; sk = str(n**k)
return k
print([a(n) for n in range(2, 102)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
Cf. A337241 (similar for k*n instead of n^k).
Sequence in context: A007263 A033336 A204325 * A102270 A102272 A304227
KEYWORD
nonn,easy,base
AUTHOR
STATUS
approved