OFFSET
2,1
COMMENTS
More precisely: smallest power of n (with positive integer exponent) whose decimal expansion contains n+1 as a substring of consecutive decimal digits. This is A[n,n+1], the diagonal above the trivial main diagonal of the array A[k,n] = Smallest power of k whose decimal expansion contains n.
The k=2 row A[2,n] = A030001.
The k=3 row A[3,n] = A176763.
The k=4 row A[4,n] = A176764.
The k=5 row A[5,n] = A176765...
a(10^k+1) = (10^k+1)^2 for k > 0. - Chai Wah Wu, Feb 13 2017
LINKS
Chai Wah Wu, Table of n, a(n) for n = 2..1999
EXAMPLE
MAPLE
a:= proc(n) local t, k;
if type(simplify(log[10](n)), integer) then 0
else t:= cat(n+1);
for k from 2 while searchtext(t, cat(n^k))=0
do od; n^k
fi
end:
seq(a(n), n=2..40); # Alois P. Heinz, Feb 26 2011
PROG
(Python)
def A186774(n):
if sum(int(d) for d in str(n)) == 1:
return 0
sn, k = str(n+1), 1
while sn not in str(k):
k *= n
return k # Chai Wah Wu, Feb 13 2017
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jonathan Vos Post, Feb 26 2011
STATUS
approved