OFFSET
2,1
COMMENTS
For all n, a(n) is at most 40000, as shown below. Is 10 an upper bound?
If n has d digits, the numbers n, n^2, ..., n^k have a total of about N = k*(k+1)*d/2, and if these were chosen randomly the probability of having no zeros would be (9/10)^N. The expected number of d-digit numbers n with f(n)>k would be 9*10^(d-1)*(9/10)^N. If k >= 7, (9/10)^(k*(k+1)/2)*10 < 1 so we would expect heuristically that there should be only finitely many n with f(n) > 7. - Robert Israel, Jan 15 2015
The similar definition using "...exactly one digit 0..." would be ill-defined for all multiples of 100 and others (1001, ...). - M. F. Hasler, Jun 25 2018
When r=40000, one of the last five digits of n^r is always 0. Working modulo 10^5, we have 2^r=9736 and 5^r=90625, and both of these are idempotent; also, if gcd(n,10)=1, then n^r=1, and if 10|n, then n^r=0. Therefore the last five digits of n^r are always either 00000, 00001, 09736, or 90625. In particular, a(n) <= 40000. - Mikhail Lavrov, Nov 18 2021
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
OEIS Wiki, Zeroless powers (2014).
FORMULA
a(n) >= 1 with equality iff n is in A011540 \ {0} = {10, 20, ..., 100, 101, ...}. - M. F. Hasler, Jun 23 2018
EXAMPLE
a(4)=5 because 4^1=4, 4^2=16, 4^3=64, 4^4=256, 4^5=1024 (has zero digit).
MAPLE
f:= proc(n) local j;
for j from 1 do if has(convert(n^j, base, 10), 0) then return j fi od:
end proc:
seq(f(n), n=2..100); # Robert Israel, Jan 15 2015
MATHEMATICA
zd[n_]:=Module[{r=1}, While[DigitCount[n^r, 10, 0]==0, r++]; r]; Array[zd, 110, 2] (* Harvey P. Dale, Apr 15 2012 *)
PROG
(Python)
def a(n):
r, p = 1, n
while 1:
if "0" in str(p):
return r
r += 1
p *= n
[a(n) for n in range(2, 100)] # Tim Peters, May 19 2005
(PARI) A071531(n)=for(k=1, oo, vecmin(digits(n^k))||return(k)) \\ M. F. Hasler, Jun 23 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Paul Stoeber (paul.stoeber(AT)stud.tu-ilmenau.de), Jun 02 2002
STATUS
approved