A186774 Smallest power of n whose decimal expansion contains n+1, or 0 if no such number exists.
32, 243, 256, 625, 7776, 16807, 4096, 31381059609, 0, 121, 79496847203390844133441536, 51185893014090757, 155568095557812224, 22168378200531005859375, 17592186044416, 118587876497, 11019960576, 42052983462257059
Offset: 2
Examples
a(2) = 32 = A030001(3) = smallest power of 2 whose decimal expansion contains 3. a(3) = 243 = A176763(4) = smallest power of 3 whose decimal expansion contains 4.
Links
- Chai Wah Wu, Table of n, a(n) for n = 2..1999
Programs
-
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
-
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
Comments