A131546 Least power of 3 having exactly n consecutive 7's in its decimal representation.
3, 11, 112, 184, 721, 3520, 6643, 12793, 67448, 208380, 364578, 1123485, 9549790, 23340555, 88637856
Offset: 1
Examples
a(2) = 11 because 3^11 = 177147 is the smallest power of 3 to contain a run of two consecutive 7's in its decimal form.
Programs
-
Mathematica
a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 10} ]
-
Python
import sys sys.set_int_max_str_digits(1000000) def A131546(n): str7 = '7'*n x, exponent = 3, 1 while not str7 in str(x): exponent += 1 x *= 3 return exponent # Chai Wah Wu, Aug 05 2014
Formula
a(1) = A063566(7). - Michel Marcus, Aug 05 2014
Extensions
a(11)-a(13) from Lars Blomberg, Feb 02 2013
a(14)-a(15) from Bert Dobbelaere, Mar 20 2019
Comments